File tree Expand file tree Collapse file tree 5 files changed +21
-17
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 5 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -1564,7 +1564,6 @@ object Parsers {
15641564 * | `(' [Patterns] `)'
15651565 * | SimplePattern1 [TypeArgs] [ArgumentPatterns]
15661566 * SimplePattern1 ::= Path
1567- * | `{' Block `}'
15681567 * | SimplePattern1 `.' id
15691568 * PatVar ::= id
15701569 * | `_'
@@ -1587,8 +1586,6 @@ object Parsers {
15871586 } else wildIndent
15881587 case LPAREN =>
15891588 atPos(in.offset) { makeTupleOrParens(inParens(patternsOpt())) }
1590- case LBRACE =>
1591- dotSelectors(blockExpr())
15921589 case XMLSTART =>
15931590 xmlLiteralPattern()
15941591 case _ =>
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ ParArgumentExprs ::= ‘(’ ExprsInParens ‘)’
202202 | ‘(’ [ExprsInParens] PostfixExpr ‘:’ ‘_’ ‘*’ ‘)’ exprs :+ Typed(expr, Ident(wildcardStar))
203203ArgumentExprs ::= ParArgumentExprs
204204 | [nl] BlockExpr
205- BlockExpr ::= ‘{’ BlockExprContents ‘}’
205+ BlockExpr ::= ‘{’ BlockExprContents ‘}’
206206BlockExprContents ::= CaseClauses | Block
207207Block ::= {BlockStat semi} [BlockResult] Block(stats, expr?)
208208BlockStat ::= Import
@@ -234,7 +234,6 @@ SimplePattern ::= PatVar
234234 | XmlPattern
235235 | SimplePattern1 [TypeArgs] [ArgumentPatterns]
236236SimplePattern1 ::= Path
237- | ‘{’ Block ‘}’
238237 | SimplePattern1 ‘.’ id
239238PatVar ::= varid
240239 | ‘_’
Original file line number Diff line number Diff line change @@ -3,17 +3,17 @@ object Test {
33 val x = 42
44 val Y = " 42"
55
6- x match { case { 42 } => () } // ok
6+ x match { case { 42 } => () } // error
77 x match { case { 42 .toString } => () } // error
88 x match { case { 42 }.toString => () } // error
99 x match { case " 42" .toInt => () } // error
10- x match { case { " 42" .toInt } => () } // ok
11- x match { case { " 42" }.toInt => () } // ok
12- x match { case { " 42" .toInt } => () } // ok
10+ x match { case { " 42" .toInt } => () } // error
11+ x match { case { " 42" }.toInt => () } // error
12+ x match { case { " 42" .toInt } => () } // error
1313 x match { case Y => () } // error
1414 x match { case Y .toInt => () } // ok
15- x match { case { Y .toInt } => () } // ok
16- x match { case { Y }.toInt => () } // ok
15+ x match { case { Y .toInt } => () } // error
16+ x match { case { Y }.toInt => () } // error
1717 x match { case Y .toString => () } // error
1818 x match { case { Y }.toString => () } // error
1919 x match { case { Y .toString } => () } // error
Original file line number Diff line number Diff line change 1+ object Test {
2+ def main (args : Array [String ]): Unit = {
3+ val x = 42
4+ val Y = " 42"
5+
6+ x match { case { 42 } => () } // error
7+ x match { case { " 42" .toInt } => () } // error
8+ x match { case { " 42" }.toInt => () } // error
9+ x match { case { " 42" .toInt } => () } // error
10+ x match { case { Y .toInt } => () } // error
11+ x match { case { Y }.toInt => () } // error
12+ x match { case Y .toInt => () } // ok
13+ }
14+ }
Original file line number Diff line number Diff line change @@ -3,12 +3,6 @@ object Test {
33 val x = 42
44 val Y = " 42"
55
6- x match { case { 42 } => () } // ok
7- x match { case { " 42" .toInt } => () } // ok
8- x match { case { " 42" }.toInt => () } // ok
9- x match { case { " 42" .toInt } => () } // ok
10- x match { case { Y .toInt } => () } // ok
11- x match { case { Y }.toInt => () } // ok
126 x match { case Y .toInt => () } // ok
137 }
148}
You can’t perform that action at this time.
0 commit comments