Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Regressive typer crash in 3.4.x #19808

Closed
jchyb opened this issue Feb 28, 2024 · 3 comments · Fixed by #19813
Closed

Regressive typer crash in 3.4.x #19808

jchyb opened this issue Feb 28, 2024 · 3 comments · Fixed by #19813
Assignees
Labels
area:nullability area:typer itype:bug itype:crash regression This worked in a previous version but doesn't anymore stat:needs minimization Needs a self contained minimization
Milestone

Comments

@jchyb
Copy link
Contributor

jchyb commented Feb 28, 2024

Compiler version

Both 3.4.0 and 3.4.1-RC1 (does not crash in 3.3.2)

Minimized code

Not yet minimized:
https://github.com/jchyb/olon-web-framework/tree/scalac-crash

Run: sbt olon-webkit/compile

The repo is in the middle of migration to scala 3, so at times the contents may be incorrect/nonsensical. In scala 3.3.x errors are shown instead of a crash. I suspect resolving those errors in 3.3.x would also fix the crash, but I wanted to submit this either way. I do not have the cycles to look into this more now, unfortunately.

Output (click arrow to expand)

[info]   exception occurred while typechecking /Users/jchyb/Documents/workspace/olon-web-framework/olon-webkit/src/main/scala/olon/http/MVCHelper.scala
[info] 
[info]   An unhandled exception was thrown in the compiler.
[info]   Please file a crash report here:
[info]   https://github.com/lampepfl/dotty/issues/new/choose
[info]   For non-enriched exceptions, compile with -Yno-enrich-error-messages.
[info] 
[info]      while compiling: /Users/jchyb/Documents/workspace/olon-web-framework/olon-webkit/src/main/scala/olon/http/MVCHelper.scala
[info]         during phase: typer
[info]                 mode: Mode(ImplicitsEnabled,ReadPositions)
[info]      library version: version 2.13.12
[info]     compiler version: version 3.4.1-RC1
[info]             settings: -Wconf List(any:silent) -Wunused List(imports) -Xsemanticdb true -bootclasspath /Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.4.1-RC1/scala3-library_3-3.4.1-RC1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar -classpath /Users/jchyb/Documents/workspace/olon-web-framework/olon-webkit/target/scala-3.4.1-RC1/classes:/Users/jchyb/Documents/workspace/olon-web-framework/olon-util/target/scala-3.4.1-RC1/classes:/Users/jchyb/Documents/workspace/olon-web-framework/olon-actor/target/scala-3.4.1-RC1/classes:/Users/jchyb/Documents/workspace/olon-web-framework/olon-common/target/scala-3.4.1-RC1/classes:/Users/jchyb/Documents/workspace/olon-web-framework/olon-json/target/scala-3.4.1-RC1/classes:/Users/jchyb/Documents/workspace/olon-web-framework/olon-testkit/target/scala-3.4.1-RC1/classes:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-fileupload2-jakarta/2.0.0-M1/commons-fileupload2-jakarta-2.0.0-M1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/mozilla/rhino/1.7.10/rhino-1.7.10.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jakarta/servlet/jakarta.servlet-api/6.0.0/jakarta.servlet-api-6.0.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/specs2/specs2-core_3/4.15.0/specs2-core_3-4.15.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/specs2/specs2-matcher-extra_3/4.15.0/specs2-matcher-extra_3-4.15.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/webjars/bower/jquery/1.11.3/jquery-1.11.3.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/webjars/bower/jasmine-core/2.4.1/jasmine-core-2.4.1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/webjars/bower/jasmine-ajax/3.2.0/jasmine-ajax-3.2.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parallel-collections_3/1.0.4/scala-parallel-collections_3-1.0.4.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.12/scala-compiler-2.13.12.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/joda-time/joda-time/2.10/joda-time-2.10.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/joda/joda-convert/2.1/joda-convert-2.1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/nu/validator/htmlparser/1.4.12/htmlparser-1.4.12.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/mindrot/jbcrypt/0.4/jbcrypt-0.4.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-fileupload2-core/2.0.0-M1/commons-fileupload2-core-2.0.0-M1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/2.13.0/commons-io-2.13.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/specs2/specs2-matcher_3/4.15.0/specs2-matcher_3-4.15.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/specs2/specs2-common_3/4.15.0/specs2-common_3-4.15.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/portable-scala/portable-scala-reflect_2.13/1.1.1/portable-scala-reflect_2.13-1.1.1.jar:/Users/jchyb/.ivy2/local/org.scala-sbt/test-interface/1.0/jars/test-interface.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/specs2/xml_3/4.15.0/xml_3-4.15.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_3/2.1.0/scala-parser-combinators_3-2.1.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/webjars/bower/jasmine/2.9.1/jasmine-2.9.1.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scalap/2.13.12/scalap-2.13.12.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.8/paranamer-2.8.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_3/2.1.0/scala-xml_3-2.1.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.12/scala-reflect-2.13.12.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.22.0/jline-3.22.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/specs2/specs2-fp_3/4.15.0/specs2-fp_3-4.15.0.jar:/Users/jchyb/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar -d /Users/jchyb/Documents/workspace/olon-web-framework/olon-webkit/target/scala-3.4.1-RC1/classes -deprecation true -feature true -language List(implicitConversions) -semanticdb-target /Users/jchyb/Documents/workspace/olon-web-framework/olon-webkit/target/scala-3.4.1-RC1/meta
[error] ## Exception when compiling 98 sources to /Users/jchyb/Documents/workspace/olon-web-framework/olon-webkit/target/scala-3.4.1-RC1/classes
[error] java.lang.AssertionError: NoDenotation.owner
[error] dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:2615)
[error] dotty.tools.dotc.typer.Nullables$.usedOutOfOrder(Nullables.scala:286)
[error] dotty.tools.dotc.typer.Nullables$.isTracked(Nullables.scala:177)
[error] dotty.tools.dotc.typer.Nullables$TrackedRef$.unapply(Nullables.scala:142)
[error] dotty.tools.dotc.typer.Nullables$.caseContext(Nullables.scala:195)
[error] dotty.tools.dotc.typer.Typer.typedCase(Typer.scala:1987)
[error] dotty.tools.dotc.typer.Typer.typedCases$$anonfun$1(Typer.scala:1912)
[error] dotty.tools.dotc.core.Decorators$.loop$1(Decorators.scala:99)
[error] dotty.tools.dotc.core.Decorators$.mapconserve(Decorators.scala:115)
[error] dotty.tools.dotc.typer.Typer.typedCases(Typer.scala:1917)
[error] dotty.tools.dotc.typer.Typer.$anonfun$37(Typer.scala:1902)
[error] dotty.tools.dotc.typer.Applications.harmonic(Applications.scala:2387)
[error] dotty.tools.dotc.typer.Applications.harmonic$(Applications.scala:351)
[error] dotty.tools.dotc.typer.Typer.harmonic(Typer.scala:120)
[error] dotty.tools.dotc.typer.Typer.typedMatchFinish(Typer.scala:1902)
[error] dotty.tools.dotc.typer.Typer.typedMatch(Typer.scala:1831)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3128)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1200)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3121)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
[error] dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1685)
[error] dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1675)
[error] dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1685)
[error] dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1947)
[error] dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:256)
[error] dotty.tools.dotc.typer.Namer.typedAheadRhs$1(Namer.scala:1947)
[error] dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1955)
[error] dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1973)
[error] dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1974)
[error] dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1985)
[error] dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1723)
[error] dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1729)
[error] dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1827)
[error] dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:808)
[error] dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:955)
[error] dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:831)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:178)
[error] dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
[error] dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
[error] dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3060)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3085)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3300)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1193)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1197)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3121)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1676)
[error] dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:1416)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3123)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
[error] dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1685)
[error] dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1675)
[error] dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1685)
[error] dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1947)
[error] dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:256)
[error] dotty.tools.dotc.typer.Namer.typedAheadRhs$1(Namer.scala:1947)
[error] dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1955)
[error] dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1973)
[error] dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1974)
[error] dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1985)
[error] dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1723)
[error] dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1729)
[error] dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1827)
[error] dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:808)
[error] dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:955)
[error] dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:831)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:178)
[error] dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
[error] dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
[error] dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3060)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3085)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3300)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
[error] dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2790)
[error] dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3101)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3105)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3196)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3300)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
[error] dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2923)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3147)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3327)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3346)
[error] dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2923)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3147)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3197)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3274)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3278)
[error] dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3389)
[error] dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:47)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:477)
[error] dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:53)
[error] dotty.tools.dotc.typer.TyperPhase.$anonfun$4(TyperPhase.scala:99)
[error] scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
[error] scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583)
[error] scala.collection.immutable.List.prependedAll(List.scala:155)
[error] scala.collection.immutable.List$.from(List.scala:684)
[error] scala.collection.immutable.List$.from(List.scala:681)
[error] scala.collection.IterableOps$WithFilter.map(Iterable.scala:898)
[error] dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:100)
[error] dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315)
[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$1(Run.scala:337)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:350)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:360)
[error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:360)
[error] dotty.tools.dotc.Run.compileSources(Run.scala:261)
[error] dotty.tools.dotc.Run.compile(Run.scala:246)
[error] dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
[error] dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:141)
[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:2371)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2321)
[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:2319)
[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: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)
[error]            
@jchyb jchyb added itype:bug area:typer itype:crash stat:needs minimization Needs a self contained minimization regression This worked in a previous version but doesn't anymore labels Feb 28, 2024
@dwijnand
Copy link
Member

dwijnand commented Feb 28, 2024

    def usedOutOfOrder(using Context): Boolean =
      val refSym = ref.symbol
      val refOwner = refSym.owner

      @tailrec def recur(s: Symbol): Boolean =
        s != NoSymbol
        && s != refOwner
        && (s.isOneOf(MethodOrLazy) // not at the rhs of lazy ValDef or in a method (or lambda)
            || s.isClass // not in a class
            || recur(s.owner))

      refSym.is(Mutable) // if it is immutable, we don't need to check the rest conditions
      && refOwner.isTerm
      && recur(ctx.owner)

refOwner is never needed if refSym isn't Mutable, and if refSym has NoDenotation (and thus no owner), then refOwner isn't needed - but it's already eagerly computed. Looks like it can lazy, or even easier refSym.maybeOwner.

@odersky
Copy link
Contributor

odersky commented Feb 28, 2024

I agree, it should be just maybeOwner.

@noti0na1
Copy link
Member

Minimized:

import scala.reflect.Selectable.reflectiveSelectable

def saveRedir(what: {def validate: List[String]}) =
  what.validate match
    case Nil => ???
    case xs  => ???

noti0na1 added a commit that referenced this issue Feb 28, 2024
…s no denotation (#19813)

Fix #19808: Don't force to compute the owner of a symbol when there is
no denotation.
@Kordyjan Kordyjan added this to the 3.4.2 milestone Mar 28, 2024
@Kordyjan Kordyjan modified the milestones: 3.4.2, 3.5.0 May 10, 2024
WojciechMazur added a commit that referenced this issue Jul 3, 2024
…en there is no denotation" to LTS (#20962)

Backports #19813 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area:nullability area:typer itype:bug itype:crash regression This worked in a previous version but doesn't anymore stat:needs minimization Needs a self contained minimization
Projects
None yet
5 participants