scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.81k stars 1.05k forks source link

"assertion failed while running inlining" with verify tests #18460

Open JD557 opened 1 year ago

JD557 commented 1 year ago

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

//> using scala "3.3.0"
//> using lib "com.eed3si9n.verify::verify::1.0.0"

import verify._

object ColorSpec extends BasicTestSuite {
  test("repro") {
    val colorA = Color(10, 20, 30)
    val colorB = Color(30, 40, 50)

    assert(colorA + colorB == Color(40, 60, 80))
  }
}

Color.scala

opaque type Color = Int

object Color {
  extension (color: Color) {

    inline def a: Int = (color >> 24) & 0x000000ff
    inline def r: Int = (color >> 16) & 0x000000ff
    inline def g: Int = (color >> 8) & 0x000000ff
    inline def b: Int = (color & 0x000000ff)
    def +(that: Color): Color =
      Color(
        Math.min(color.r + that.r, 255).toInt,
        Math.min(color.g + that.g, 255).toInt,
        Math.min(color.b + that.b, 255).toInt
      )
  }

  def apply(r: Int, g: Int, b: Int): Color =
    (255 << 24) | ((r & 255) << 16) | ((g & 255) << 8) | (b & 255)
}

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.(Applications.scala:772) [error] dotty.tools.dotc.typer.Applications$ApplyToUntyped.(Applications.scala:889) [error] dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1119) [error] dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:352) [error] dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:115) [error] dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:962) [error] dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$2(Applications.scala:1045) [error] dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3198) [error] dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1056) [error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1094) [error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:814) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.Applications.realApply$1(Applications.scala:934) [error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1094) [error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:814) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.ProtoTypes$FunProto.$anonfun$7(ProtoTypes.scala:493) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:416) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:494) [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.(Applications.scala:772) [error] dotty.tools.dotc.typer.Applications$ApplyToUntyped.(Applications.scala:889) [error] dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1119) [error] dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:352) [error] dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:115) [error] dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:962) [error] dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$2(Applications.scala:1045) [error] dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3198) [error] dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1056) [error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1094) [error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:814) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.inlines.Inliner$InlineTyper.typedSelect(Inliner.scala:764) [error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2897) [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:3055) [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.Applications.realApply$1(Applications.scala:934) [error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1094) [error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:814) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.ProtoTypes$FunProto.$anonfun$7(ProtoTypes.scala:493) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:416) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:494) [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.(Applications.scala:772) [error] dotty.tools.dotc.typer.Applications$ApplyToUntyped.(Applications.scala:889) [error] dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1119) [error] dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:352) [error] dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:115) [error] dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:962) [error] dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$2(Applications.scala:1045) [error] dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3198) [error] dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1056) [error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1094) [error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:814) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.typedInlined(Typer.scala:1955) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2950) [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.ProtoTypes$FunProto.$anonfun$7(ProtoTypes.scala:493) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:416) [error] dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:494) [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.matchArgs(Applications.scala:646) [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.(Applications.scala:772) [error] dotty.tools.dotc.typer.Applications$ApplyToUntyped.(Applications.scala:889) [error] dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1119) [error] dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:352) [error] dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:115) [error] dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:962) [error] dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$2(Applications.scala:1045) [error] dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3198) [error] dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1056) [error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1094) [error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:814) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.typedInlined(Typer.scala:1955) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2950) [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.typedInlined(Typer.scala:1955) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2950) [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.traverse$1(Typer.scala:3111) [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.typedInlined(Typer.scala:1955) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2950) [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:3055) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3062) [error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3174) [error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedApply(Inliner.scala:820) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928) [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.ReTyper.typedTyped(ReTyper.scala:64) [error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2933) [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:3055) [error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3062) [error] dotty.tools.dotc.inlines.Inliner.inlined(Inliner.scala:671) [error] dotty.tools.dotc.inlines.Inlines$InlineCall.expand(Inlines.scala:444) [error] dotty.tools.dotc.inlines.Inlines$.inlineCall(Inlines.scala:151) [error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:99) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1228) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1228) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformBlock(tpd.scala:1233) [error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1429) [error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:49) [error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:95) [error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1510) [error] scala.collection.immutable.List.mapConserve(List.scala:472) [error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1510) [error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1415) [error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:73) [error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:115) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1228) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1228) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1230) [error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:64) [error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:115) [error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1483) [error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:73) [error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:93) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1228) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1228) [error] dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1230) [error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1491) [error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:73) [error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:105) [error] dotty.tools.dotc.transform.Inlining$$anon$2.transform(Inlining.scala:62) [error] dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:18) [error] dotty.tools.dotc.transform.Inlining.run(Inlining.scala:34) [error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:324) [error] scala.collection.immutable.List.map(List.scala:250) [error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:328) [error] dotty.tools.dotc.transform.Inlining.runOn(Inlining.scala:38) [error] dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:247) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) [error] scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1321) [error] dotty.tools.dotc.Run.runPhases$1(Run.scala:263) [error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:271) [error] dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:280) [error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67) [error] dotty.tools.dotc.Run.compileUnits(Run.scala:280) [error] dotty.tools.dotc.Run.compileSources(Run.scala:195) [error] dotty.tools.dotc.Run.compile(Run.scala:179) [error] dotty.tools.dotc.Driver.doCompile(Driver.scala:35) [error] dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88) [error] dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22) [error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91) [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193) [error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248) [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183) [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163) [error] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239) [error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163) [error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211) [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534) [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534) [error] sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:180) [error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:178) [error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:464) [error] sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116) [error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56) [error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52) [error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263) [error] sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:419) [error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506) [error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:406) [error] sbt.internal.inc.Incremental$.apply(Incremental.scala:172) [error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534) [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488) [error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332) [error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425) [error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137) [error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2369) [error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2319) [error] sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:31) [error] sbt.internal.io.Retry$.apply(Retry.scala:47) [error] sbt.internal.io.Retry$.apply(Retry.scala:29) [error] sbt.internal.io.Retry$.apply(Retry.scala:24) [error] sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:31) [error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2317) [error] scala.Function1.$anonfun$compose$1(Function1.scala:49) [error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63) [error] sbt.std.Transform$$anon$4.work(Transform.scala:69) [error] sbt.Execute.$anonfun$submit$2(Execute.scala:283) [error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24) [error] sbt.Execute.work(Execute.scala:292) [error] sbt.Execute.$anonfun$submit$1(Execute.scala:283) [error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265) [error] sbt.CompletionService$$anon$2.call(CompletionService.scala:65) [error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) [error] java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577) [error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) [error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [error] java.base/java.lang.Thread.run(Thread.java:1623) [error] [error] stack trace is suppressed; run last Test / compileIncremental for the full output [error] (Test / compileIncremental) java.lang.AssertionError: assertion failed ```
nicolasstucki commented 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

JD557 commented 1 year ago

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