File tree Expand file tree Collapse file tree 8 files changed +23
-12
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 8 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ object Parsers {
341
341
case NEWLINE | NEWLINES => in.nextToken()
342
342
case SEMI => in.nextToken()
343
343
case _ =>
344
+ syntaxError(" end of statement expected" )
344
345
in.nextToken() // needed to ensure progress; otherwise we might cycle forever
345
346
accept(SEMI )
346
347
}
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ object Test {
8
8
def f = {
9
9
val _parent = 3
10
10
q " val hello = $_parent"
11
- q " class $_" // error
11
+ q " class $_" // error // error
12
12
} // error
13
13
}
Original file line number Diff line number Diff line change
1
+ object Foo {
2
+ val a = " " ); // error: end of statement expected
3
+ }
4
+ // From #5824:
5
+ object Main {
6
+ def main (args : Array [String ]): Unit = {
7
+ val foo = 123 " " ; // error: end of statement expected
8
+ println(foo)
9
+ }
10
+ }
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ class x0[x0] {
2
2
val x1 : x0
3
3
}
4
4
trait x3 extends x0 { // error
5
- x1 = 0 object // error
5
+ x1 = 0 object // error // error
6
6
// error
Original file line number Diff line number Diff line change 1
1
trait x0 [] { x0 : x0 => } // error // error
2
- class x0 [x1] extends x0[x0 x0] x2 x0 // error // error
2
+ class x0 [x1] extends x0[x0 x0] x2 x0 // error // error // error
Original file line number Diff line number Diff line change 1
1
object i0 {
2
- import Ordering .{ implicitly => } (true: Boolean ) match { case _: i1 => true } // error // error
2
+ import Ordering .{ implicitly => } (true: Boolean ) match { case _: i1 => true } // error // error // error
3
3
}
Original file line number Diff line number Diff line change 1
1
class x0 {
2
- def x0 : x0 = (x0 => x0) => x0) // error
2
+ def x0 : x0 = (x0 => x0) => x0) // error // error
3
3
// error
Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ object Test extends App {
42
42
locally {
43
43
def f (): Int = b + 1
44
44
val x1 = if (true ) b else if (true ) 33 else 5.5 ; x1 : Double // b is an inline val
45
- val x2 = if (true ) f() else if (true ) 33 else 5.5 ) ; x2 : AnyVal // f() is not a constant
46
- val x3 = if (true ) 5 else 11L ) ; x3 : Long
47
- val x4 = if (true ) 5 else if (true ) 11L else 5.5 ) ; x4 : AnyVal // Long and Double found
48
- val x5 = if (true ) 1.0f else 2 ) ; x5 : Float
49
- val x6 = if (true ) 1.0f else 1234567890 ) ; x6 : AnyVal // loss of precision
50
- val x7 = if (true ) b else if (true ) 33 else 'a' ) ; x7 : Char
51
- val x8 = if (true ) 5 .toByte else 11 ) ; x8 : Byte
45
+ val x2 = if (true ) f() else if (true ) 33 else 5.5 ; x2 : AnyVal // f() is not a constant
46
+ val x3 = if (true ) 5 else 11L ; x3 : Long
47
+ val x4 = if (true ) 5 else if (true ) 11L else 5.5 ; x4 : AnyVal // Long and Double found
48
+ val x5 = if (true ) 1.0f else 2 ; x5 : Float
49
+ val x6 = if (true ) 1.0f else 1234567890 ; x6 : AnyVal // loss of precision
50
+ val x7 = if (true ) b else if (true ) 33 else 'a' ; x7 : Char
51
+ val x8 = if (true ) 5 .toByte else 11 ; x8 : Byte
52
52
}
53
53
}
You can’t perform that action at this time.
0 commit comments