You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also notice that "currentRun.compiles()" is broken for symbols of trees defined in annotations of top-level classes.
class foo(x: Any) extends annotation.StaticAnnotation
@foo({classC; ()}) traitAYou can see the problem by calling `companionSymbolOf` during Namers:~/code/scala git diff
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tool
index cac6bd2..89a2f2f 100644--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@-258,11+258,15@@traitNamersextendsMethodSynthesis {
returnContext = context.make(tree)
case _ =>
}
+if (tree.symbol !=null&& tree.symbol !=NoSymbol)
+ companionSymbolOf(tree.symbol, this.context)
+
returnContext
}
tree.symbol match {
caseNoSymbol=>try dispatch() catch typeErrorHandler(tree, this.context)
-case sym => enterExistingSym(sym)
+case sym =>+ enterExistingSym(sym)
}
}
@@-1703,7+1707,7@@traitNamersextendsMethodSynthesis {
// SI-7264 Force the info of owners from previous compilation runs.// Doing this generally would trigger cycles; that's what we also// use the lower-level scan through the current Context as a fall back.-if (!currentRun.compiles(owner)) owner.initialize
+if (!owner.ownerChain.exists(_.isLocalDummy) &&!currentRun.compiles(owner)) owner.init
original.companionSymbol orElse {
That diff also has an idea for a workaround for that case (which is being explored in the experimental Namer in macro paradise that calls this indirectly through companionSymbolOf.:
I also notice that "currentRun.compiles()" is broken for symbols of trees defined in annotations of top-level classes.
class foo(x: Any) extends annotation.StaticAnnotation
That diff also has an idea for a workaround for that case (which is being explored in the experimental Namer in macro paradise that calls this indirectly through
companionSymbolOf
.:https://github.com/scalamacros/paradise/blob/2.10.3/plugin/src/main/scala/org/scalalang/macroparadise/typechecker/Namers.scala#L152)
The text was updated successfully, but these errors were encountered: