Skip to content
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

An object in sealed trait inside of a function crashes the compiler #17135

Closed
arturaz opened this issue Mar 21, 2023 · 7 comments · Fixed by #17159
Closed

An object in sealed trait inside of a function crashes the compiler #17135

arturaz opened this issue Mar 21, 2023 · 7 comments · Fixed by #17159

Comments

@arturaz
Copy link

arturaz commented Mar 21, 2023

Compiler version

3.3.1-RC1-bin-20230318-7226ba6-NIGHTLY

Minimized code

package doobie

def someFunction(param: Int): Int = {
  sealed trait Foo {
    def asString: String = this match {
      case Foo.CaseC => "C"
    }
  }
  object Foo {
    // Having an object here crashes the compiler.
    object CaseC extends Foo
  }

  ???
}

Output (click arrow to expand)

Processing buildTarget/compile
compiling 1 Scala source to W:\work\unity\sb-win\server\doobie-typesafe\target\scala-3.3.1-RC1-bin-20230318-7226ba6-NIGHTLY\test-classes ...
## Exception when compiling 10 sources to W:\work\unity\sb-win\server\doobie-typesafe\target\scala-3.3.1-RC1-bin-20230318-7226ba6-NIGHTLY\test-classes
java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:169)
dotty.tools.dotc.transform.ExplicitOuter$.dotty$tools$dotc$transform$ExplicitOuter$$$outerParamAccessor(ExplicitOuter.scala:229)
dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.loop$1(ExplicitOuter.scala:465)
dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.path$extension(ExplicitOuter.scala:474)
dotty.tools.dotc.transform.LambdaLift$Lifter.memberRef(LambdaLift.scala:161)
dotty.tools.dotc.transform.LambdaLift$Lifter.proxyRef(LambdaLift.scala:167)
dotty.tools.dotc.transform.LambdaLift$Lifter.addFreeArgs$$anonfun$1(LambdaLift.scala:172)
scala.collection.immutable.List.map(List.scala:246)
dotty.tools.dotc.transform.LambdaLift$Lifter.addFreeArgs(LambdaLift.scala:172)
dotty.tools.dotc.transform.LambdaLift.transformApply(LambdaLift.scala:310)
dotty.tools.dotc.transform.LambdaLift.transformApply(LambdaLift.scala:309)
dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:650)
dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:280)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
dotty.tools.dotc.transform.MegaPhase.mapDefDef$1(MegaPhase.scala:248)
dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
dotty.tools.dotc.transform.MegaPhase.loop$2(MegaPhase.scala:444)
dotty.tools.dotc.transform.MegaPhase.transformBlock(MegaPhase.scala:449)
dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:298)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
dotty.tools.dotc.transform.MegaPhase.mapDefDef$1(MegaPhase.scala:248)
dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:379)
dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:382)
dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:454)
dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:466)
dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:324)
scala.collection.immutable.List.map(List.scala:246)
dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:328)
dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:246)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1321)
dotty.tools.dotc.Run.runPhases$1(Run.scala:262)
dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:270)
dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:279)
dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
dotty.tools.dotc.Run.compileUnits(Run.scala:279)
dotty.tools.dotc.Run.compileSources(Run.scala:194)
dotty.tools.dotc.Run.compile(Run.scala:179)
dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88)
dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193)
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163)
sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163)
sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:179)
sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:177)
sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:463)
sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:418)
sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506)
sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:405)
sbt.internal.inc.Incremental$.apply(Incremental.scala:171)
sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2363)
sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2313)
sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:30)
sbt.internal.io.Retry$.apply(Retry.scala:46)
sbt.internal.io.Retry$.apply(Retry.scala:28)
sbt.internal.io.Retry$.apply(Retry.scala:23)
sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:30)
sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2311)
scala.Function1.$anonfun$compose$1(Function1.scala:49)
sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
sbt.std.Transform$$anon$4.work(Transform.scala:68)
sbt.Execute.$anonfun$submit$2(Execute.scala:282)
sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
sbt.Execute.work(Execute.scala:291)
sbt.Execute.$anonfun$submit$1(Execute.scala:282)
sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base/java.lang.Thread.run(Thread.java:833)
java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:169)
	at dotty.tools.dotc.transform.ExplicitOuter$.dotty$tools$dotc$transform$ExplicitOuter$$$outerParamAccessor(ExplicitOuter.scala:229)
	at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.loop$1(ExplicitOuter.scala:465)
	at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.path$extension(ExplicitOuter.scala:474)
	at dotty.tools.dotc.transform.LambdaLift$Lifter.memberRef(LambdaLift.scala:161)
	at dotty.tools.dotc.transform.LambdaLift$Lifter.proxyRef(LambdaLift.scala:167)
	at dotty.tools.dotc.transform.LambdaLift$Lifter.addFreeArgs$$anonfun$1(LambdaLift.scala:172)
	at scala.collection.immutable.List.map(List.scala:246)
	at dotty.tools.dotc.transform.LambdaLift$Lifter.addFreeArgs(LambdaLift.scala:172)
	at dotty.tools.dotc.transform.LambdaLift.transformApply(LambdaLift.scala:310)
	at dotty.tools.dotc.transform.LambdaLift.transformApply(LambdaLift.scala:309)
	at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:650)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:280)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.mapDefDef$1(MegaPhase.scala:248)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$2(MegaPhase.scala:444)
	at dotty.tools.dotc.transform.MegaPhase.transformBlock(MegaPhase.scala:449)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:298)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.mapDefDef$1(MegaPhase.scala:248)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:379)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:382)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:454)
	at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:466)
	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:324)
	at scala.collection.immutable.List.map(List.scala:246)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:328)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:246)
	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:1321)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:262)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:270)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:279)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:279)
	at dotty.tools.dotc.Run.compileSources(Run.scala:194)
	at dotty.tools.dotc.Run.compile(Run.scala:179)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
	at dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88)
	at dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163)
	at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163)
	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:179)
	at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:177)
	at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:463)
	at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
	at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:418)
	at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506)
	at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:405)
	at sbt.internal.inc.Incremental$.apply(Incremental.scala:171)
	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2363)
	at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2313)
	at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:30)
	at sbt.internal.io.Retry$.apply(Retry.scala:46)
	at sbt.internal.io.Retry$.apply(Retry.scala:28)
	at sbt.internal.io.Retry$.apply(Retry.scala:23)
	at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:30)
	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2311)
	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
	at sbt.Execute.work(Execute.scala:291)
	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
(doobieTypesafe / Test / compileIncremental) java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>

Workaround

Replace sealed trait with Scala 3 enum.

@arturaz arturaz added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 21, 2023
@arturaz arturaz changed the title An object in sealed trait insite of a function crashes the compiler An object in sealed trait inside of a function crashes the compiler Mar 21, 2023
@SethTisue
Copy link
Member

note the lack of an enriched crash report, despite #17031

@som-snytt
Copy link
Contributor

also it's not finessed.

@anatoliykmetyuk anatoliykmetyuk added area:transform and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 27, 2023
@SethTisue
Copy link
Member

SethTisue commented Mar 27, 2023

Scala 3 meeting notes:

  • likely culprit is ExplicitOuter (EDIT: oh, of course, we see that in the stack trace; we didn't unfold the stack trace in the meeting)
  • sealed unnecessary, but trait vs class matters

@plokhotnyuk
Copy link

plokhotnyuk commented Mar 27, 2023

I have a compiler error for a generic trait when moving its definition to a nested function body:

sealed trait GADT2[A] extends Product with Serializable

object GADT2 {
  case class IsDir(path: String) extends GADT2[_root_.scala.Boolean]
  case class Exists(path: String) extends GADT2[_root_.scala.Boolean]
  case class ReadBytes(path: String) extends GADT2[_root_.scala.Array[_root_.scala.Byte]]
  case class CopyOver(src: Seq[_root_.scala.Byte], path: String) extends GADT2[Int]
}
The compiler log with an error
[error] ## Exception when compiling 12 sources to /home/andriy/Projects/com/github/plokhotnyuk/jsoniter-scala/jsoniter-scala-macros/jvm/target/scala-3.2.2/test-classes
[error] java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
[error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
[error] dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:169)
[error] dotty.tools.dotc.transform.ExplicitOuter$.dotty$tools$dotc$transform$ExplicitOuter$$$outerParamAccessor(ExplicitOuter.scala:228)
[error] dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.loop$1(ExplicitOuter.scala:464)
[error] dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.path$extension(ExplicitOuter.scala:473)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedThis(Erasure.scala:796)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2896)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedIf(Typer.scala:1136)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedIf(Erasure.scala:873)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2904)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3078)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedLabeled(Typer.scala:1766)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2888)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.typer.Typer.$anonfun$51(Typer.scala:2356)
[error] dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
[error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2356)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:944)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2871)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3022)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedTyped(Erasure.scala:629)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2900)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3022)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1922)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedInlined(Erasure.scala:888)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2917)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1069)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.typer.Typer.$anonfun$51(Typer.scala:2356)
[error] dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
[error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2356)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:944)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2871)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1921)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedInlined(Erasure.scala:888)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2917)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3078)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.typer.Typer.$anonfun$51(Typer.scala:2356)
[error] dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
[error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2356)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:944)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2871)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:827)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3078)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2532)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedClassDef(Erasure.scala:1032)
[error] dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2883)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2887)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2659)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] dotty.tools.dotc.transform.Erasure.run(Erasure.scala:144)
[error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:316)
[error] scala.collection.immutable.List.map(List.scala:250)
[error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:320)
[error] dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:238)
[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:249)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:257)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:266)
[error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:266)
[error] dotty.tools.dotc.Run.compileSources(Run.scala:190)
[error] dotty.tools.dotc.Run.compile(Run.scala:174)
[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:209)
[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:179)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:177)
[error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:463)
[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:418)
[error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506)
[error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:405)
[error] sbt.internal.inc.Incremental$.apply(Incremental.scala:171)
[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:2363)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2313)
[error] sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:30)
[error] sbt.internal.io.Retry$.apply(Retry.scala:46)
[error] sbt.internal.io.Retry$.apply(Retry.scala:28)
[error] sbt.internal.io.Retry$.apply(Retry.scala:23)
[error] sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:30)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2311)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] sbt.Execute.work(Execute.scala:291)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] java.base/java.lang.Thread.run(Thread.java:833)
[error]            
[error] java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
[error] 	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:169)
[error] 	at dotty.tools.dotc.transform.ExplicitOuter$.dotty$tools$dotc$transform$ExplicitOuter$$$outerParamAccessor(ExplicitOuter.scala:228)
[error] 	at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.loop$1(ExplicitOuter.scala:464)
[error] 	at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.path$extension(ExplicitOuter.scala:473)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedThis(Erasure.scala:796)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2896)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] 	at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] 	at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedIf(Typer.scala:1136)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedIf(Erasure.scala:873)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2904)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3078)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedLabeled(Typer.scala:1766)
[error] 	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2888)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.typer.Typer.$anonfun$51(Typer.scala:2356)
[error] 	at dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
[error] 	at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2356)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:944)
[error] 	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2871)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3022)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedTyped(Erasure.scala:629)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2900)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3022)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1922)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedInlined(Erasure.scala:888)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2917)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] 	at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1069)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.typer.Typer.$anonfun$51(Typer.scala:2356)
[error] 	at dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
[error] 	at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2356)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:944)
[error] 	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2871)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] 	at dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1921)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedInlined(Erasure.scala:888)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2917)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3078)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.typer.Typer.$anonfun$51(Typer.scala:2356)
[error] 	at dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
[error] 	at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2356)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:944)
[error] 	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2871)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1063)
[error] 	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1067)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2903)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.$anonfun$9(Erasure.scala:840)
[error] 	at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:152)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:840)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:827)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2895)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3078)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2532)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedClassDef(Erasure.scala:1032)
[error] 	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2883)
[error] 	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2887)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2957)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3051)
[error] 	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3101)
[error] 	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
[error] 	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2659)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2928)
[error] 	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2958)
[error] 	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3025)
[error] 	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3029)
[error] 	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3145)
[error] 	at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:144)
[error] 	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:316)
[error] 	at scala.collection.immutable.List.map(List.scala:250)
[error] 	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:320)
[error] 	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:238)
[error] 	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] 	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] 	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1321)
[error] 	at dotty.tools.dotc.Run.runPhases$1(Run.scala:249)
[error] 	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:257)
[error] 	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:266)
[error] 	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
[error] 	at dotty.tools.dotc.Run.compileUnits(Run.scala:266)
[error] 	at dotty.tools.dotc.Run.compileSources(Run.scala:190)
[error] 	at dotty.tools.dotc.Run.compile(Run.scala:174)
[error] 	at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
[error] 	at dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88)
[error] 	at dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163)
[error] 	at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:209)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:179)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:177)
[error] 	at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:463)
[error] 	at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
[error] 	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
[error] 	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
[error] 	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:418)
[error] 	at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506)
[error] 	at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:405)
[error] 	at sbt.internal.inc.Incremental$.apply(Incremental.scala:171)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
[error] 	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2363)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2313)
[error] 	at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:30)
[error] 	at sbt.internal.io.Retry$.apply(Retry.scala:46)
[error] 	at sbt.internal.io.Retry$.apply(Retry.scala:28)
[error] 	at sbt.internal.io.Retry$.apply(Retry.scala:23)
[error] 	at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:30)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2311)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] 	at sbt.Execute.work(Execute.scala:291)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] 	at java.base/java.lang.Thread.run(Thread.java:833)
[error] (jsoniter-scala-macrosJVM / Test / compileIncremental) java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
[error] Total time: 39 s, completed Mar 23, 2023, 11:17:57 AM

Is it the same issue or should be tracked separately?

@SethTisue
Copy link
Member

@plokhotnyuk I think we can reasonably assume it's the same

@odersky
Copy link
Contributor

odersky commented Mar 28, 2023

More simplifications:

def someFunction(param: Int): Int = {
  trait Foo {
    def asString: String = this match {
      case Foo.CaseC => "C"
    }
  }
  object Foo {
    // Having an object here crashes the compiler.
    lazy val CaseC = new Foo {}  // compiles OK without lazy
  }

  ???

So, it seems to be a bad feature interaction between 3 phases

  • explicit outer, which thinks it does not need an outer accessor for the trait (not sure whether that's correct or not)
  • lazy vals, which creates code that requires the outer accessor (not sure whether it's only the new implementation, or the old one had that problem as well)
  • lambda lift, which generates the outer access when it tries to access a proxy and fails.

odersky added a commit to dotty-staging/dotty that referenced this issue Mar 28, 2023
scala#17135 shows that traits also need an outer accessor if they are in a toplevel
method (or lazy val).

Fixes scala#17135
@odersky
Copy link
Contributor

odersky commented Mar 28, 2023

In fact, the fault was exclusively ExplicitOuter's.

@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants