diff options
author | paltherr <paltherr@epfl.ch> | 2003-12-12 18:12:33 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-12-12 18:12:33 +0000 |
commit | f2de9c44a848de76d6b70656d951cd6208423ecb (patch) | |
tree | e482e44fe4ffb56dcf0400823bc1e34905bd1539 | |
parent | 787f3ff9929f3c29ef7d340010a128b668332bd5 (diff) | |
download | scala-f2de9c44a848de76d6b70656d951cd6208423ecb.tar.gz scala-f2de9c44a848de76d6b70656d951cd6208423ecb.tar.bz2 scala-f2de9c44a848de76d6b70656d951cd6208423ecb.zip |
- Fixed methods location and selection
-rw-r--r-- | sources/scalac/checkers/TreeChecker.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sources/scalac/checkers/TreeChecker.java b/sources/scalac/checkers/TreeChecker.java index d908b8ac1e..1d86b5efae 100644 --- a/sources/scalac/checkers/TreeChecker.java +++ b/sources/scalac/checkers/TreeChecker.java @@ -264,24 +264,20 @@ public class TreeChecker { } } - //######################################################################## - // Private Methods - Checking locations - /** Checks the location. Returns true. */ - public boolean location(Tree tree) { + private boolean location(Tree tree) { + Symbol symbol = tree.symbol(); + assert symbol != null && symbol.isTerm(): show(tree); + assert !symbol.isMethod(): show(tree); switch (tree) { case Select(_, _): - Symbol symbol = tree.symbol(); - assert symbol != null && symbol.isTerm(): show(tree); - assert !symbol.isMethod(): show(tree); return selection(tree); case Ident(_): - Symbol symbol = tree.symbol(); - assert symbol != null && symbol.isTerm(): show(tree); if (symbol.isModule()) return true; assert vvars.contains(symbol): show(tree); + assert symbol.owner() == currentMember(): show(tree); return true; default: @@ -293,7 +289,7 @@ public class TreeChecker { // Private Methods - Checking selection /** Checks the selection. Returns true. */ - public boolean selection(Tree tree) { + private boolean selection(Tree tree) { switch (tree) { case Select(Tree qualifier, _): @@ -301,9 +297,8 @@ public class TreeChecker { assert symbol != null && symbol.isTerm(): show(tree); Symbol owner = symbol.owner(); assert owner.isClassType(): show(tree); - Type prefix = qualifier.type(); - assert prefix.baseType(owner) != Type.NoType: show(tree); - return expression(qualifier, prefix); + assert qualifier.type().baseType(owner) != Type.NoType: show(tree); + return expression(qualifier, qualifier.type()); default: throw Debug.abort("illegal case", tree); |