Compiler crash when switching Scala version

I have a compiler crash that has occurred a few times, but I haven’t found a simple way to reproduce it. I’m also not really sure whether to file this as a compiler bug or sbt bug, so any advise there is kindly appreciated.

I think it’s related to switching Scala versions, at least that’s when it’s occurred. Then when gradually removing code to find a minimal sample, it suddenly stopped crashing. Undoing the removes did not re-introduce the crash, however. When the crashes were occurring, switching to the previously working Scala version, without changing the code, did not remove the crash. Neither did running clean in sbt.

The annoying bit with reproducing it is that switching Scala versions no longer triggers the crash for me. I’m not sure how the caching works in sbt, but maybe some cache invalidation doesn’t work properly the first time upgrading a project to a new Scala version? I upgraded from 3.0.0 to 3.0.1-RC1 and then to 3.0.1-RC2.

So yeah, unfortunately I don’t have much help to offer for reproducing the issue, but I thought I’d give some context at least.
Here’s the error message: dotty.tools.dotc.core.Denotations$StaleSymbol: stale symbol; method apply#27824 in module class ParseErr$, defined in Period(1..53, run = 2), is referred to in run Period(9..9, run = 3)

Where ParseErr is defined like this:

case class ParseErr(s: String, start: Option[Int] = None, end: Option[Int] = None)
object ParseErr {
  def apply(s: String, tok: Token): ParseErr = ParseErr(s, Some(tok.pos), Some(tok.end))
}

This is the stack trace:

Summary
[error] dotty.tools.dotc.core.Denotations$StaleSymbol: stale symbol; method apply#27824 in module class ParseErr$, defined in Period(1..53, run = 2), is referred to in run Period(9..9, run = 3)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.staleSymbolError(Denotations.scala:955)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:754)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.toNewRun$1(Denotations.scala:803)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:877)
[error] dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:122)
[error] dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:116)
[error] dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:109)
[error] dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:494)
[error] dotty.tools.dotc.core.SourceLanguage$.apply(TypeErasure.scala:28)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.signature(Denotations.scala:602)
[error] dotty.tools.dotc.core.Types$NamedType.sigFromDenot(Types.scala:2112)
[error] dotty.tools.dotc.core.Types$NamedType.currentSignature(Types.scala:2101)
[error] dotty.tools.dotc.core.Types$NamedType.disambiguate(Types.scala:2218)
[error] dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2241)
[error] dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2209)
[error] dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2168)
[error] dotty.tools.dotc.core.Types$NamedType.computeSymbol(Types.scala:2123)
[error] dotty.tools.dotc.core.Types$NamedType.symbol(Types.scala:2118)
[error] dotty.tools.dotc.core.Types$Type.termSymbol(Types.scala:582)
[error] dotty.tools.dotc.typer.Inliner$$anon$1.apply(Inliner.scala:804)
[error] dotty.tools.dotc.typer.Inliner$$anon$1.apply(Inliner.scala:800)
[error] dotty.tools.dotc.ast.TreeTypeMap.mapType(TreeTypeMap.scala:72)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:105)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:142)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1437)
[error] scala.collection.immutable.List.mapConserve(List.scala:472)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1437)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:142)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1327)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:142)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1335)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:142)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:142)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:122)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1341)
[error] dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:142)
[error] dotty.tools.dotc.typer.Inliner.inlined(Inliner.scala:846)
[error] dotty.tools.dotc.typer.Inliner$.inlineCall(Inliner.scala:153)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:86
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1437)
[error] scala.collection.immutable.List.mapConserve(List.scala:472)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1437)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:94
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:94
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:103)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:80
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:53)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:60)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1347)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:95)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:82
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1437)
[error] scala.collection.immutable.List.mapConserve(List.scala:472)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1437)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:94
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1347)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:95)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:82
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:103)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:80
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:53)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:60)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.recur$1(TreeMapWithImplicits.scala:35
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.recur$1(TreeMapWithImplicits.scala:41
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.recur$1(TreeMapWithImplicits.scala:41
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:54)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:60)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:111)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:80
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1410)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:80
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:53)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:60)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1421)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
[error] dotty.tools.dotc.transform.Inlining$InliningTreeMap.transform(Inlining.scala:94
[error] dotty.tools.dotc.transform.Inlining$$anon$2.transform(Inlining.scala:72)
[error] dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:21)
[error] dotty.tools.dotc.transform.Inlining.run(Inlining.scala:44)
[error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:303)
[error] scala.collection.immutable.List.map(List.scala:246)
[error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:304)
[error] dotty.tools.dotc.transform.Inlining.runOn(Inlining.scala:48)
[error] dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
[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:1323)
[error] dotty.tools.dotc.Run.runPhases$5(Run.scala:216)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:224)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
[error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:231)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:172)
[error] dotty.tools.dotc.Driver.finish(Driver.scala:60)
[error] dotty.tools.dotc.Driver.doCompile(Driver.scala:40)
[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:186)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:241)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:176)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:157)
[error] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:157)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:204)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:174)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:172)
[error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:457)
[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:261)
[error] sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:412)
[error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:499)
[error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:399)
[error] sbt.internal.inc.Incremental$.apply(Incremental.scala:166)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:482)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:420)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2357)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2314)
[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:31)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2310)
[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:515)
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] java.base/java.lang.Thread.run(Thread.java:829)
2 Likes

Update: encountered this again, randomly when compiling. Unrelated to switching Scala versions this time. Was using sbt ~compile and suddenly on recompilation it crashed (and like before, did not recover). Seems tied to the incremental compilation, but again, not sure if it’s an error on sbt’s or dotc’s part.

I tried removing the definitions of ParseErr and its companion object (not uses of the type though) this time and got another error: assertion failed: NoType

Summary

[error] java.lang.AssertionError: assertion failed: NoType
[error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
[error] dotty.tools.dotc.core.Types$TypeBounds.(Types.scala:4791)
[error] dotty.tools.dotc.core.Types$RealTypeBounds.(Types.scala:4852)
[error] dotty.tools.dotc.core.Types$TypeBounds$.apply(Types.scala:4896)
[error] dotty.tools.dotc.core.Types$TypeBounds.derivedTypeBounds(Types.scala:4799)
[error] dotty.tools.dotc.core.Types$TypeMap.derivedTypeBounds(Types.scala:5215)
[error] dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5293)
[error] dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5356)
[error] dotty.tools.dotc.typer.ImplicitRunInfo$$anon$1.apply(Implicits.scala:750)
[error] dotty.tools.dotc.core.Types$TypeMap.op$proxy16$1(Types.scala:5246)
[error] dotty.tools.dotc.core.Types$TypeMap.mapArgs(Types.scala:5246)
[error] dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5281)
[error] dotty.tools.dotc.typer.ImplicitRunInfo$$anon$1.apply(Implicits.scala:750)
[error] dotty.tools.dotc.typer.ProtoTypes$ViewProto.map(ProtoTypes.scala:550)
[error] dotty.tools.dotc.typer.ProtoTypes$ViewProto.map(ProtoTypes.scala:550)
[error] dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5313)
[error] dotty.tools.dotc.typer.ImplicitRunInfo$$anon$1.apply(Implicits.scala:750)
[error] dotty.tools.dotc.typer.ImplicitRunInfo.implicitScope(Implicits.scala:752)
[error] dotty.tools.dotc.typer.ImplicitRunInfo.implicitScope$(Implicits.scala:538)
[error] dotty.tools.dotc.Run.implicitScope(Run.scala:38)
[error] dotty.tools.dotc.typer.Implicits$ImplicitSearch.implicitScope(Implicits.scala:1402)
[error] dotty.tools.dotc.typer.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1365)
[error] dotty.tools.dotc.typer.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1374)
[error] dotty.tools.dotc.typer.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1399)
[error] dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:974)
[error] dotty.tools.dotc.typer.Implicits.inferImplicit$(Implicits.scala:769)
[error] dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:106)
[error] dotty.tools.dotc.typer.Implicits.inferView(Implicits.scala:815)
[error] dotty.tools.dotc.typer.Implicits.inferView$(Implicits.scala:769)
[error] dotty.tools.dotc.typer.Typer.inferView(Typer.scala:106)
[error] dotty.tools.dotc.typer.Implicits.viewExists(Implicits.scala:782)
[error] dotty.tools.dotc.typer.Implicits.viewExists$(Implicits.scala:769)
[error] dotty.tools.dotc.typer.Typer.viewExists(Typer.scala:106)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.necessarilyCompatible(ProtoTypes.scala:47)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.necessarilyCompatible$(ProtoTypes.scala:26)
[error] dotty.tools.dotc.typer.Typer.necessarilyCompatible(Typer.scala:106)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult(ProtoTypes.scala:108)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult$(ProtoTypes.scala:26)
[error] dotty.tools.dotc.typer.Typer.constrainResult(Typer.scala:106)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult(ProtoTypes.scala:97)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult$(ProtoTypes.scala:26)
[error] dotty.tools.dotc.typer.Typer.constrainResult(Typer.scala:106)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult(ProtoTypes.scala:128)
[error] dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult$(ProtoTypes.scala:26)
[error] dotty.tools.dotc.typer.Typer.constrainResult(Typer.scala:106)
[error] dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:896)
[error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1031)
[error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:316)
[error] dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:106)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2695)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2758)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2943)
[error] dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:609)
[error] dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:659)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2665)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2757)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2943)
[error] dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:881)
[error] dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1031)
[error] dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:316)
[error] dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:106)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2695)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2758)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2943)
[error] dotty.tools.dotc.typer.Typer.$anonfun$34(Typer.scala:2168)
[error] dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:225)
[error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2168)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2672)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2757)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2849)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2899)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1023)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1027)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2703)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2758)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2943)
[error] dotty.tools.dotc.typer.Typer.$anonfun$34(Typer.scala:2168)
[error] dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:225)
[error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2168)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2672)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2757)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2849)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2899)
[error] dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2354)
[error] dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2683)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2687)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2757)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2849)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2899)
[error] dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2477)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2728)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2758)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2823)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2827)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2943)
[error] dotty.tools.dotc.typer.FrontEnd.liftedTree1$1(FrontEnd.scala:79)
[error] dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:84)
[error] dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:43)
[error] dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:85)
[error] dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:120)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] scala.collection.immutable.List.foreach(List.scala:333)
[error] dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:120)
[error] dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
[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:1323)
[error] dotty.tools.dotc.Run.runPhases$5(Run.scala:216)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:224)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
[error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:231)
[error] dotty.tools.dotc.Run.compileSources(Run.scala:166)
[error] dotty.tools.dotc.Run.compile(Run.scala:150)
[error] dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
[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:186)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:241)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:176)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:157)
[error] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:157)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:204)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:174)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:172)
[error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:457)
[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:261)
[error] sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:412)
[error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:499)
[error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:399)
[error] sbt.internal.inc.Incremental$.apply(Incremental.scala:166)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:482)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:420)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2357)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2314)
[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:31)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2310)
[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:515)
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] java.base/java.lang.Thread.run(Thread.java:829)

Can you open an issue with complete code? Incremental compilation bugs are notoriously hard to debug and stacktraces alone are usually not enough. So having something to experiment with is essential.