Open JD557 opened 1 year ago
This seems to be an issue related to an inline method. We will need a minimization to be able to understand what is failing.
The failure is in the following assertion: https://github.com/lampepfl/dotty/blob/release-3.3.0/compiler/src/dotty/tools/dotc/typer/Typer.scala#L2335
I couldn't get a better minimization, but after playing around with it a bit, the code seems to compile if I remove this line from verify: https://github.com/eed3si9n/verify/blob/main/shared/src/main/scala-3/verify/asserts/RecorderMacro.scala#L36
Compiler version
3.3.0 (also happens on 3.3.1-RC5)
Minimized code
The following code reproduces the problem in scala-cli using
scala-cli compile Color.scala ColorSpec.scala
. Note that this only happens if the code is in two different files. If I put all the code in a single file, it will compile just fine.ColorSpec.scala
Color.scala
Output (click arrow to expand)
scala-cli output
``` Compiling project (Scala 3.3.0, JVM) exception occurred while compiling D:\Projects\minart\examples\snapshot\Color.scala, D:\Projects\minart\examples\snapshot\ColorSpec.scala Error compiling project (Scala 3.3.0, JVM) Error: Unexpected error when compiling snapshot_ba1af71ecb-ae6ae97c6d: 'assertion failed' Compilation failed ```sbt output (on a larger project where I spotted the problem)
``` java.lang.AssertionError: assertion failed while running inlining on D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\ColorSpec.scala [info] exception occurred while compiling D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\audio\AudioClipSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\audio\AudioQueueSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\ColorSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\MatrixSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\MutableSurfaceTests.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\PlaneSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\RamSurfaceSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\SurfaceViewSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\input\KeyboardInputSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\input\PointerInputSpec.scala java.lang.AssertionError: assertion failed while compiling D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\audio\AudioClipSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\audio\AudioQueueSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\ColorSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\MatrixSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\MutableSurfaceTests.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\PlaneSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\RamSurfaceSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\graphics\SurfaceViewSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\input\KeyboardInputSpec.scala, D:\Projects\minart\core\shared\src\test\scala\eu\joaocosta\minart\input\PointerInputSpec.scala [error] ## Exception when compiling 10 sources to D:\Projects\minart\core\jvm\target\scala-3.3.0\test-classes [error] java.lang.AssertionError: assertion failed [error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11) [error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2335) [error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2904) [error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2990) [error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedUnadapted(Inliner.scala:904) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3058) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3062) [error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3084) [error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3130) [error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1096) [error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1100) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2936) [error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2991) [error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedUnadapted(Inliner.scala:904) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3058) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3062) [error] dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1536) [error] dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:1309) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2938) [error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2991) [error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedUnadapted(Inliner.scala:904) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3058) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3062) [error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3174) [error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1102) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2936) [error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2991) [error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedUnadapted(Inliner.scala:904) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3058) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3062) [error] dotty.tools.dotc.typer.Typer.adaptNoArgsUnappliedMethod$1(Typer.scala:3766) [error] dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3905) [error] dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4120) [error] dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3435) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:495) [error] dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:890) [error] dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:890) [error] dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:582) [error] dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:646) [error] dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:485) [error] dotty.tools.dotc.typer.Applications$TypedApply.