Open abeln opened 5 years ago
Smaller repro of the failure:
class Foo extends scala.util.control.NoStackTrace { }
The problem is that https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#fillInStackTrace() returns a Throwable|JavaNull, but since the standard library is non-boostrapped, there's no type error in NoStackTrace, where there should be one:
Throwable|JavaNull
NoStackTrace
https://github.com/scala/scala/blob/v2.12.6/src/library/scala/util/control/NoStackTrace.scala#L24
As a result, when we Ycheck resolveSuper, there's a type error dotc -Ycheck:resolveSuper -Xprint:resolveSuper kk.scala
dotc -Ycheck:resolveSuper -Xprint:resolveSuper kk.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: found: Throwable | JavaNull required: Throwable tree = super[Throwable].fillInStackTrace() java.lang.AssertionError: assertion failed: found: Throwable | JavaNull required: Throwable tree = super[Throwable].fillInStackTrace() while compiling kk.scala at scala.Predef$.assert(Predef.scala:219) at dotty.tools.dotc.transform.TreeChecker$Checker.adapt(TreeChecker.sca
This should be fixed when we port the standard library, but the more general solution will require binary compatibility.
Opened an issue for binary compat: https://github.com/abeln/dotty/issues/17
Smaller repro of the failure:
The problem is that https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#fillInStackTrace() returns a
Throwable|JavaNull
, but since the standard library is non-boostrapped, there's no type error inNoStackTrace
, where there should be one:https://github.com/scala/scala/blob/v2.12.6/src/library/scala/util/control/NoStackTrace.scala#L24
As a result, when we Ycheck resolveSuper, there's a type error
dotc -Ycheck:resolveSuper -Xprint:resolveSuper kk.scala