diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-14 09:44:17 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-03-14 09:44:17 +0100 |
commit | 722661c0bada3a8e64512bda2ac7501b1c02ec10 (patch) | |
tree | a94c071b6eeea5092f3c01c48dd1e7ce421c48e2 /docs | |
parent | db950e5e168f6fd71a367da343e352139e8d653e (diff) | |
download | dotty-722661c0bada3a8e64512bda2ac7501b1c02ec10.tar.gz dotty-722661c0bada3a8e64512bda2ac7501b1c02ec10.tar.bz2 dotty-722661c0bada3a8e64512bda2ac7501b1c02ec10.zip |
Fixed two problems with annotated types in patterns
Problem 1: The parser did not accept them. It has to accept a "RefinedType" as an ascription,
not a "WithType" (as it did before), or even a "SimpleType" (as speced in the SyntaxSummary).
Problem 2: Annotations are always typed as expressions. The annotations in question were typed
as patterns before.
Tests in Patterns.scala and in the Dotty compiler itself.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SyntaxSummary.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/SyntaxSummary.txt b/docs/SyntaxSummary.txt index 97486f0ad..3d60f74f2 100644 --- a/docs/SyntaxSummary.txt +++ b/docs/SyntaxSummary.txt @@ -191,13 +191,13 @@ grammar. CaseClause ::= `case' (Pattern [Guard] `=>' Block | INT) CaseDef(pat, guard?, block) // block starts at => Pattern ::= Pattern1 { `|' Pattern1 } Alternative(pats) - Pattern1 ::= PatVar `:' SimpleType Bind(name, Typed(Ident(wildcard), tpe)) + Pattern1 ::= PatVar `:' RefinedType Bind(name, Typed(Ident(wildcard), tpe)) | Pattern2 Pattern2 ::= [varid `@'] InfixPattern Bind(name, pat) InfixPattern ::= SimplePattern { id [nl] SimplePattern } InfixOp(pat, op, pat) SimplePattern ::= PatVar Ident(wildcard) - | Literal Bind(name, Ident(wildcard)) | Literal - | `(' [Patterns] `)' Parens(pats) Tuple(pats) + | Literal Bind(name, Ident(wildcard)) + | `(' [Patterns] `)' Parens(pats) Tuple(pats) | XmlPattern | SimplePattern1 [TypeArgs] [ArgumentPatterns] SimplePattern1 ::= Path |