diff options
author | paltherr <paltherr@epfl.ch> | 2004-03-06 15:50:23 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-03-06 15:50:23 +0000 |
commit | 8ba6023e7aa181b4e7e3206caf29c0550315f5b4 (patch) | |
tree | f3282a488b1c7c20eb7158ef1c162e27dfd905c7 /sources/scalac/atree/ATreeFromSTree.java | |
parent | 72a496a3c41ae105c852ea0f7fee1712efd68264 (diff) | |
download | scala-8ba6023e7aa181b4e7e3206caf29c0550315f5b4.tar.gz scala-8ba6023e7aa181b4e7e3206caf29c0550315f5b4.tar.bz2 scala-8ba6023e7aa181b4e7e3206caf29c0550315f5b4.zip |
- 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.
Diffstat (limited to 'sources/scalac/atree/ATreeFromSTree.java')
-rw-r--r-- | sources/scalac/atree/ATreeFromSTree.java | 19 |
1 files changed, 9 insertions, 10 deletions
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); |