File tree 4 files changed +13
-3
lines changed
compiler/src/dotty/tools/dotc/parsing 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -960,8 +960,9 @@ object Scanners {
960
960
'|' | '\\ ' =>
961
961
putChar(ch); nextChar(); getOperatorRest()
962
962
case '/' =>
963
- if (skipComment()) finishNamed()
964
- else { putChar('/' ); getOperatorRest() }
963
+ val nxch = lookaheadChar()
964
+ if nxch == '/' || nxch == '*' then finishNamed()
965
+ else { putChar(ch); nextChar(); getOperatorRest() }
965
966
case _ =>
966
967
if (isSpecial(ch)) { putChar(ch); nextChar(); getOperatorRest() }
967
968
else finishNamed()
Original file line number Diff line number Diff line change
1
+ -- [E006] Not Found Error: tests/neg/i10268.scala:2:16 -----------------------------------------------------------------
2
+ 2 | def test[T] = ?//test // error
3
+ | ^
4
+ | Not found: ?
5
+
6
+ longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+ object Main {
2
+ def test [T ] = ?// test // error
3
+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ val x = 1
5
5
val b1 = {
6
6
22
7
7
* 22 // ok
8
- */* one more*/ 22 // error: end of statement expected
8
+ */* one more*/ 22 // error: end of statement expected // error: not found: *
9
9
} // error: ';' expected, but '}' found
10
10
11
11
val b2 : Boolean = {
You can’t perform that action at this time.
0 commit comments