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
-- Error: abc.scala ----------------------------------------------------------------------------------------------------
1 |class DuplicateClassName { () => {
| ^^
| not a legal self type clause
exception occurred while typechecking abc.scala
exception occurred while compiling abc.scala
Exception in thread "main" java.lang.NullPointerException
at dotty.tools.dotc.ast.tpd$.ref(tpd.scala:321)
at dotty.tools.dotc.ast.untpd$.ref(untpd.scala:319)
at dotty.tools.dotc.ast.desugar$.apply(Desugar.scala:936)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1478)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1484)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1494)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1492)
at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:132)
at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
<snipped>
The text was updated successfully, but these errors were encountered:
This issue is related to #1683 and #1424 . We've decided to treat the code as a syntactical error, as @odersky commented here:
I think we should not try to overengineer fixing this. The scalac code doing this is quite impenetrable. I think "not a legal self type clause" is perfectly fine as an error message.
scalac compiles but dotc crashes.
$ cat abc.scala
$ dotc abc.scala
The text was updated successfully, but these errors were encountered: