Open WojciechMazur opened 3 days ago
cc @smarter @jchyb
https://github.com/scala/scala3/pull/20409 was a stopgap, as noted by Martin in the PR we should really only traverse the symbols of trees we're currently compiling which are therefore guaranteed to not be stale (it seemsisDefinedInCurrentRun
is not enough when macros are involved due to the SuspendException mechanism), if we want another stopgap, we can move the isExperimental check earlier, since unlike the sym.source
it doesn't force the companion:
diff --git compiler/src/dotty/tools/dotc/typer/Checking.scala compiler/src/dotty/tools/dotc/typer/Checking.scala
index 700bd483ff..eae34c2304 100644
--- compiler/src/dotty/tools/dotc/typer/Checking.scala
+++ compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -807,10 +807,10 @@ object Checking {
def nonExperimentalTopLevelDefs(pack: Symbol): Iterator[Symbol] =
def isNonExperimentalTopLevelDefinition(sym: Symbol) =
sym.isDefinedInCurrentRun
+ && !sym.isExperimental
&& sym.source == ctx.compilationUnit.source
&& !sym.isConstructor // not constructor of package object
&& !sym.is(Package) && !sym.name.isPackageObjectName
- && !sym.isExperimental
pack.info.decls.toList.iterator.flatMap: sym =>
if sym.isClass && (sym.is(Package) || sym.isPackageObject) then
Based on OpenCB failure in 2 projects:
jodersky/ustats
- build logsrssh/dotty-cps-async
- build logsCompiler version
Last good release: 3.5.0-RC1-bin-20240515-177b489-NIGHTLY First bad release: 3.5.0-RC1-bin-20240516-c608177-NIGHTLY Bisect points to c8764bac0f555b2d3c9f42403d1ae216960d28ad
Minimized code
Output
Expectation
Should compile