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
➜ dotty git:(feature/287) ✗ cat noend.scala
classC:deftest= g
deff(b: Boolean):Int=if b then end if42defg=27endC➜ dotty git:(feature/287) ✗ scalac -d /tmp noend.scala
-- [E018] SyntaxError: noend.scala:5:13--------------------------------------------------------------------------------------------------------5|if b then|^| expression expected but end found
longer explanation available when compiling with`-explain`-- [E040] SyntaxError: noend.scala:10:0--------------------------------------------------------------------------------------------------------10||^|unindent expected, but eof found
-- [E006] NotFoundError: noend.scala:3:13-----------------------------------------------------------------------------------------------------3|deftest= g
|^|Notfound: g
longer explanation available when compiling with`-explain`3 errors found
Output
|unindent expected, but eof found
Expectation
Especially in presence of end, should not consume to eof looking for outdent. It causes cascading errors.
Expect one error at if.
The text was updated successfully, but these errors were encountered:
- Drop Indented region only after seeing an OUTDENT node. This aligns
region stack popping with the other closing tokens `]`, `)`, and `}`
and thereby fixes a problem in `skip`.
- When skipping, allow OUTDENT insertions even in n on-indent regions
if the outdent matches a previous indent. This improves recovert when
closing `]`, `)`, or `}` are missing.
- When skipping an OUTDENT that matches a previous indent can discard
nested regions.
Fixesscala#14507
Compiler version
3.1.1
Minimized code
Output
|unindent expected, but eof found
Expectation
Especially in presence of
end
, should not consume toeof
looking for outdent. It causes cascading errors.Expect one error at
if
.The text was updated successfully, but these errors were encountered: