File tree 5 files changed +21
-17
lines changed
compiler/src/dotty/tools/dotc/parsing
5 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -1564,7 +1564,6 @@ object Parsers {
1564
1564
* | `(' [Patterns] `)'
1565
1565
* | SimplePattern1 [TypeArgs] [ArgumentPatterns]
1566
1566
* SimplePattern1 ::= Path
1567
- * | `{' Block `}'
1568
1567
* | SimplePattern1 `.' id
1569
1568
* PatVar ::= id
1570
1569
* | `_'
@@ -1587,8 +1586,6 @@ object Parsers {
1587
1586
} else wildIndent
1588
1587
case LPAREN =>
1589
1588
atPos(in.offset) { makeTupleOrParens(inParens(patternsOpt())) }
1590
- case LBRACE =>
1591
- dotSelectors(blockExpr())
1592
1589
case XMLSTART =>
1593
1590
xmlLiteralPattern()
1594
1591
case _ =>
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ ParArgumentExprs ::= ‘(’ ExprsInParens ‘)’
202
202
| ‘(’ [ExprsInParens] PostfixExpr ‘:’ ‘_’ ‘*’ ‘)’ exprs :+ Typed(expr, Ident(wildcardStar))
203
203
ArgumentExprs ::= ParArgumentExprs
204
204
| [nl] BlockExpr
205
- BlockExpr ::= ‘{’ BlockExprContents ‘}’
205
+ BlockExpr ::= ‘{’ BlockExprContents ‘}’
206
206
BlockExprContents ::= CaseClauses | Block
207
207
Block ::= {BlockStat semi} [BlockResult] Block(stats, expr?)
208
208
BlockStat ::= Import
@@ -234,7 +234,6 @@ SimplePattern ::= PatVar
234
234
| XmlPattern
235
235
| SimplePattern1 [TypeArgs] [ArgumentPatterns]
236
236
SimplePattern1 ::= Path
237
- | ‘{’ Block ‘}’
238
237
| SimplePattern1 ‘.’ id
239
238
PatVar ::= varid
240
239
| ‘_’
Original file line number Diff line number Diff line change @@ -3,17 +3,17 @@ object Test {
3
3
val x = 42
4
4
val Y = " 42"
5
5
6
- x match { case { 42 } => () } // ok
6
+ x match { case { 42 } => () } // error
7
7
x match { case { 42 .toString } => () } // error
8
8
x match { case { 42 }.toString => () } // error
9
9
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
13
13
x match { case Y => () } // error
14
14
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
17
17
x match { case Y .toString => () } // error
18
18
x match { case { Y }.toString => () } // error
19
19
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 {
3
3
val x = 42
4
4
val Y = " 42"
5
5
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
12
6
x match { case Y .toInt => () } // ok
13
7
}
14
8
}
You can’t perform that action at this time.
0 commit comments