File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -735,8 +735,8 @@ object Scanners {
735735 case _ => false
736736 currentRegion match
737737 case r : Indented if isEnclosedInParens(r.outer) =>
738- // For some region prefixes ( COLONeol, EQUALS) only OUTDENT if COMMA at EOL
739- if canStartIndentTokens.contains( r.prefix) && ! statCtdTokens.contains(r.prefix) then
738+ // For region prefix COLONeol, only OUTDENT if COMMA at EOL
739+ if r.prefix == COLONeol then
740740 val lookahead = LookaheadScanner ()
741741 lookahead.nextToken()
742742 if lookahead.isAfterLineEnd then
Original file line number Diff line number Diff line change @@ -6,12 +6,6 @@ def test: Unit =
66 true , " ok" // error end of statement expected but ',' found
77 )
88
9- def toss : Unit =
10- assert(
11- throw
12- null , " ok" // error same
13- )
14-
159def callme [A ](x : => A , msg : String ) = try x.toString catch case t : RuntimeException => msg
1610
1711// not all indented regions require COMMA at EOL for OUTDENT
@@ -22,3 +16,10 @@ def orElse(x: Int): Unit =
2216 true // error ',' or ')' expected, but 'true' found
2317 else
2418 false , " fail" )
19+
20+ def g : Unit =
21+ identity(
22+ x =
23+ class X extends AnyRef , Serializable // error
24+ 27 // error
25+ )
Original file line number Diff line number Diff line change @@ -6,13 +6,6 @@ def f: Unit =
66 42
77 )
88
9- def g : Unit =
10- identity(
11- x =
12- class X extends AnyRef , Serializable
13- 27
14- )
15-
169def test : Unit =
1710 assert(
1811 identity :
@@ -26,6 +19,11 @@ def toss: Unit =
2619 null ,
2720 " ok"
2821 )
22+ def raise : Unit =
23+ assert(
24+ throw
25+ null , " ok" // ok now
26+ )
2927
3028def callme [A ](x : => A , msg : String ) = try x.toString catch case t : RuntimeException => msg
3129
You can’t perform that action at this time.
0 commit comments