What's going on? Is this intended?
Sorry, that was a typo. I meant the RootPackage symbol.This one: final object RootPackage extends ModuleSymbol(rootOwner, NoPosition, nme.ROOTPKG)
Also see Hubert's comments to https://issues.scala-lang.org/browse/SI-6201The problem is that root package qualifier from root.scala.xml.Null somehow gets past Typer and later we crash.
Okay, RootPackage gets its lateMETHOD flag because of this code in refchecks:override def transformInfo(sym: Symbol, tp: Type): Type = {
if (sym.isModule && !sym.isStatic) sym setFlag (lateMETHOD | STABLE)
super.transformInfo(sym, tp)
}
Right. Or we could alternatively override isStatic in root symbols (which I think would be a good idea anyways).But I want to get to the bottom of it. It seems that typer after refactoring doesn't strip off RootPackage qualifiers as in "if (qual1.symbol == RootPackage) treeCopy.Ident(tree1, name) else tree1". Weird.
Okay found it. `Tree.hasSymbolWhich` is implemented incorrectly. The offending patch adds a check for this.hasSymbol, which is false for Apply nodes. Hence _root_ qualifier doesn't get stripped off, and bad things happen.
Okay, RootPackage gets its lateMETHOD flag because of this code in refchecks:override def transformInfo(sym: Symbol, tp: Type): Type = {
if (sym.isModule && !sym.isStatic) sym setFlag (lateMETHOD | STABLE)
super.transformInfo(sym, tp)
}
On 10 August 2012 21:48, Eugene Burmako <eugene....@epfl.ch> wrote:
Sorry, that was a typo. I meant the RootPackage symbol.This one: final object RootPackage extends ModuleSymbol(rootOwner, NoPosition, nme.ROOTPKG)On 10 August 2012 21:40, Paul Phillips <pa...@improving.org> wrote:
On Fri, Aug 10, 2012 at 12:16 PM, Eugene Burmako <eugene....@epfl.ch> wrote:
What's going on? Is this intended?Which symbols specifically?
If a tree does not have a symbol (ie hasSymbol is false) then clearly hasSymbolWhich should also be false. Clients need to take that into account.
Apply.hasSymbol is false, but it does have a symbol, because it overrides the symbol getter with fun.symbol.So either Apply.hasSymbol is incorrect, or we should allow for Apply as it has been done before.