From 8ba6023e7aa181b4e7e3206caf29c0550315f5b4 Mon Sep 17 00:00:00 2001 From: paltherr Date: Sat, 6 Mar 2004 15:50:23 +0000 Subject: - Generalized the use of static types/trees in ... - Generalized the use of static types/trees in static contextes. Now all this-types should refer to an enclosing class and all Tree.Select should refer a non-static class member. --- sources/scalac/atree/ATreeFromSTree.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'sources/scalac/atree/ATreeFromSTree.java') diff --git a/sources/scalac/atree/ATreeFromSTree.java b/sources/scalac/atree/ATreeFromSTree.java index 6c83e5e6a8..c67ac19e93 100644 --- a/sources/scalac/atree/ATreeFromSTree.java +++ b/sources/scalac/atree/ATreeFromSTree.java @@ -295,13 +295,14 @@ public class ATreeFromSTree { switch (tree) { case Select(Tree qualifier, _): - if (symbol.isJava() && symbol.owner().isModuleClass()) - return AFunction.Method(make.Void, symbol, AInvokeStyle.StaticClass); // !!! qualifier is ignored ! - ACode object = expression(qualifier); - return AFunction.Method(object, symbol, invokeStyle(qualifier)); + AInvokeStyle style = invokeStyle(qualifier); + return AFunction.Method(expression(qualifier), symbol, style); case Ident(_): - return AFunction.Method(make.Void, symbol, AInvokeStyle.New); + AInvokeStyle style = symbol.isInitializer() + ? AInvokeStyle.New + : AInvokeStyle.StaticClass; + return AFunction.Method(make.Void, symbol, style); default: throw Debug.abort("illegal case", tree); @@ -327,15 +328,13 @@ public class ATreeFromSTree { switch (tree) { case Select(Tree qualifier, _): - if (symbol.isModule()) - return ALocation.Module(symbol); // !!! qualifier is ignored ! - if (symbol.isJava() && symbol.owner().isModuleClass()) - return ALocation.Field(make.Void, symbol, true); // !!! qualifier is ignored ! return ALocation.Field(expression(qualifier), symbol, false); case Ident(_): if (symbol.isModule()) return ALocation.Module(symbol); - return ALocation.Local(symbol, symbol.isParameter()); + return symbol.owner().isClass() + ? ALocation.Field(make.Void, symbol, true) + : ALocation.Local(symbol, symbol.isParameter()); default: throw Debug.abort("illegal case", tree); -- cgit v1.2.3