diff options
author | paltherr <paltherr@epfl.ch> | 2003-12-12 18:06:37 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-12-12 18:06:37 +0000 |
commit | 144f8735b759f4ff26e413e684baa609d71b41df (patch) | |
tree | cfe67c51cfbcf5c9304b23bdd4b1e443a50469ed | |
parent | 910667e39a730ad825f80c6c3a5b37aa52339377 (diff) | |
download | scala-144f8735b759f4ff26e413e684baa609d71b41df.tar.gz scala-144f8735b759f4ff26e413e684baa609d71b41df.tar.bz2 scala-144f8735b759f4ff26e413e684baa609d71b41df.zip |
- Added method type
-rw-r--r-- | sources/scalac/checkers/TreeChecker.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sources/scalac/checkers/TreeChecker.java b/sources/scalac/checkers/TreeChecker.java index fb6f635bdc..219e0b249d 100644 --- a/sources/scalac/checkers/TreeChecker.java +++ b/sources/scalac/checkers/TreeChecker.java @@ -260,6 +260,29 @@ public class TreeChecker { } //######################################################################## + // Private Methods - Checking type + + private boolean type(Tree tree, Type expected, Type loBound) { + if (!loBound.isSubType(tree.type())) { + Type.explainSwitch = true; + assert loBound.isSubType(tree.type()): show(tree) + + format("loBound", expected); + Type.explainSwitch = false; + } + return type(tree, expected); + } + + private boolean type(Tree tree, Type expected) { + if (!tree.type().isSubType(expected)) { + Type.explainSwitch = true; + assert tree.type().isSubType(expected): show(tree) + + format("expected", expected); + Type.explainSwitch = false; + } + return true; + } + + //######################################################################## // Private Methods - Declaring symbols /** Do the trees contain the given symbols? */ |