You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since an interpolation is really two tokens deep, for the literal
part and the interpolated expression, one-char lookahead does not
preserve the second token on reset.
Make lookahead itself more robust by falling back to a LookaheadScanner
for this case.
Also add an internal error for the bad reset.
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/parsing/Scanners.scala
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -695,10 +695,10 @@ object Scanners {
695
695
getNextToken(token)
696
696
if token ==END&&!isEndMarker then token =IDENTIFIER
697
697
698
-
defreset() = {
698
+
defreset() =
699
+
if next.token !=EMPTY&&!isInstanceOf[LookaheadScanner] then report.error(s"Internal: lookAhead/reset would erase next token ${tokenString(next.token)} after ${tokenString(token)}", sourcePos())
0 commit comments