-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler crash when using CanThrow #20206
Comments
Full crash output: exception while retyping this.foo.foo.apply of class Select # -1
An unhandled exception was thrown in the compiler.
Please file a crash report here:
https://github.com/scala/scala3/issues/new/choose
For non-enriched exceptions, compile with -Yno-enrich-error-messages.
while compiling: /Users/pchabelski/IdeaProjects/scala-cli-tests/compiler-repro/.scala-build/compiler-repro_ed26d7ea58-c6d3736935/src_generated/main/repro-script.scala
during phase: MegaPhase{elimErasedValueType, pureStats, vcElideAllocations, etaReduce, arrayApply, elimPolyFunction, tailrec, completeJavaEnums, mixin, lazyVals, memoize, nonLocalReturns, capturedVars}
mode: Mode(ImplicitsEnabled)
library version: version 2.13.12
compiler version: version 3.4.1
settings: -classpath /Users/pchabelski/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.4.1/scala3-library_3-3.4.1.jar:/Users/pchabelski/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar -d /Users/pchabelski/IdeaProjects/scala-cli-tests/compiler-repro/.scala-build/compiler-repro_ed26d7ea58-c6d3736935/classes/main -experimental true -java-output-version 17 -sourceroot /Users/pchabelski/IdeaProjects/scala-cli-tests/compiler-repro
Exception in thread "main" java.lang.AssertionError: assertion failed: bad adapt for this.foo().foo: (using x$1: repro$minusscript$_.this.MyEvidence): String
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
at dotty.tools.dotc.transform.Erasure$Boxing$.adaptToType(Erasure.scala:391)
at dotty.tools.dotc.transform.Erasure$Typer.adapt(Erasure.scala:1091)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.transform.Erasure$Typer.typedSelect(Erasure.scala:671)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3088)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:843)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3113)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.transform.Erasure$Typer.typedSelect(Erasure.scala:671)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3088)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:843)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3113)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
at dotty.tools.dotc.typer.Typer.$anonfun$62(Typer.scala:2603)
at dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:256)
at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2603)
at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:960)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3095)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3300)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1073)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2790)
at dotty.tools.dotc.transform.Erasure$Typer.typedClassDef(Erasure.scala:1049)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3101)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3105)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3300)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1073)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2790)
at dotty.tools.dotc.transform.Erasure$Typer.typedClassDef(Erasure.scala:1049)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3101)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3105)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3300)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1073)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2923)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3147)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:174)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:144)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:354)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:360)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:337)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:350)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:360)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
at dotty.tools.dotc.Run.compileUnits(Run.scala:360)
at dotty.tools.dotc.Run.compileSources(Run.scala:261)
at dotty.tools.dotc.Run.compile(Run.scala:246)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
at dotty.tools.dotc.Driver.process(Driver.scala:196)
at dotty.tools.dotc.Driver.process(Driver.scala:164)
at dotty.tools.dotc.Driver.process(Driver.scala:176)
at dotty.tools.dotc.Driver.main(Driver.scala:206)
at dotty.tools.dotc.Main.main(Main.scala)
Compilation failed |
Minimization: //> using options -experimental -Yno-experimental
import language.experimental.erasedDefinitions
erased trait A
trait B
def foo: (A, B) ?=> Nothing = ???
def bar: (A, B) ?=> Nothing = foo It has nothing to do specifically with |
Changing the signature of For now, I was able to narrow it down to the computation of |
@hamzaremmal I wanted to take a look at it, but see you already have fixed it. That was fast! |
Compiler version
3.4.1
Minimized code
Output
The text was updated successfully, but these errors were encountered: