File tree 3 files changed +14
-15
lines changed
compiler/src/dotty/tools/dotc/parsing
3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -735,8 +735,8 @@ object Scanners {
735
735
case _ => false
736
736
currentRegion match
737
737
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
740
740
val lookahead = LookaheadScanner ()
741
741
lookahead.nextToken()
742
742
if lookahead.isAfterLineEnd then
Original file line number Diff line number Diff line change @@ -6,12 +6,6 @@ def test: Unit =
6
6
true , " ok" // error end of statement expected but ',' found
7
7
)
8
8
9
- def toss : Unit =
10
- assert(
11
- throw
12
- null , " ok" // error same
13
- )
14
-
15
9
def callme [A ](x : => A , msg : String ) = try x.toString catch case t : RuntimeException => msg
16
10
17
11
// not all indented regions require COMMA at EOL for OUTDENT
@@ -22,3 +16,10 @@ def orElse(x: Int): Unit =
22
16
true // error ',' or ')' expected, but 'true' found
23
17
else
24
18
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 =
6
6
42
7
7
)
8
8
9
- def g : Unit =
10
- identity(
11
- x =
12
- class X extends AnyRef , Serializable
13
- 27
14
- )
15
-
16
9
def test : Unit =
17
10
assert(
18
11
identity :
@@ -26,6 +19,11 @@ def toss: Unit =
26
19
null ,
27
20
" ok"
28
21
)
22
+ def raise : Unit =
23
+ assert(
24
+ throw
25
+ null , " ok" // ok now
26
+ )
29
27
30
28
def callme [A ](x : => A , msg : String ) = try x.toString catch case t : RuntimeException => msg
31
29
You can’t perform that action at this time.
0 commit comments