diff options
author | Martin Odersky <odersky@gmail.com> | 2003-11-14 16:55:21 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-11-14 16:55:21 +0000 |
commit | 1ce2b54384639ff358071e8965a5cf39a5a43882 (patch) | |
tree | 4b17bb9ca078870b163db66db8f3ba77849ade00 /sources/scalac/ast | |
parent | d71d7bb6f1f6924cb27662b73fdcbf2b37bfd3ae (diff) | |
download | scala-1ce2b54384639ff358071e8965a5cf39a5a43882.tar.gz scala-1ce2b54384639ff358071e8965a5cf39a5a43882.tar.bz2 scala-1ce2b54384639ff358071e8965a5cf39a5a43882.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r-- | sources/scalac/ast/Tree.java.tmpl | 4 | ||||
-rw-r--r-- | sources/scalac/ast/TreeCloner.java | 2 | ||||
-rw-r--r-- | sources/scalac/ast/TreeGen.java | 18 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sources/scalac/ast/Tree.java.tmpl b/sources/scalac/ast/Tree.java.tmpl index e39768b597..dc5c93ed91 100644 --- a/sources/scalac/ast/Tree.java.tmpl +++ b/sources/scalac/ast/Tree.java.tmpl @@ -60,7 +60,7 @@ public class Tree { // Public Methods - tree type /** Get the type of the node. */ - public Type type() { + public Type getType() { assert type != null : Debug.show(this); return type; } @@ -75,7 +75,7 @@ public class Tree { /** Get types attached to array of nodes. */ public static Type[] typeOf(Tree[] trees) { Type[] types = new Type[trees.length]; - for (int i = 0; i < trees.length; i++) types[i] = trees[i].type(); + for (int i = 0; i < trees.length; i++) types[i] = trees[i].getType(); return types; } diff --git a/sources/scalac/ast/TreeCloner.java b/sources/scalac/ast/TreeCloner.java index 30a63b9255..ff05b4d256 100644 --- a/sources/scalac/ast/TreeCloner.java +++ b/sources/scalac/ast/TreeCloner.java @@ -74,7 +74,7 @@ public class TreeCloner extends Transformer { * type map to the given tree's type. */ public Type getTypeFor(Tree tree) { - return types.apply(tree.type()); + return types.apply(tree.getType()); } /** Traverses the given tree and returns a deeply cloned one. */ diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java index 047a6dfd86..1f18b8a979 100644 --- a/sources/scalac/ast/TreeGen.java +++ b/sources/scalac/ast/TreeGen.java @@ -690,9 +690,9 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { /** Builds an If node with given condition and branches. */ public If If(int pos, Tree cond, Tree thenpart, Tree elsepart) { global.nextPhase(); - Type type = thenpart.type().isSameAs(elsepart.type()) + Type type = thenpart.getType().isSameAs(elsepart.getType()) ? thenpart.type - : Type.lub(new Type[] {thenpart.type(), elsepart.type()}); + : Type.lub(new Type[] {thenpart.getType(), elsepart.getType()}); global.prevPhase(); return If(pos, cond, thenpart, elsepart, type); } @@ -722,8 +722,8 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { Tree otherwise) { Type[] types = new Type[bodies.length + 1]; - for (int i = 0; i < bodies.length; i++) types[i] = bodies[i].type(); - types[bodies.length] = otherwise.type(); + for (int i = 0; i < bodies.length; i++) types[i] = bodies[i].getType(); + types[bodies.length] = otherwise.getType(); global.nextPhase(); Type type = Type.lub(types); global.prevPhase(); @@ -938,7 +938,7 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { /** Builds an CaseDef node with given pattern, guard and body. */ public CaseDef CaseDef(Tree pattern, Tree guard, Tree body) { CaseDef tree = make.CaseDef(pattern.pos, pattern, guard, body); - tree.setType(body.type()); + tree.setType(body.getType()); return tree; } @@ -969,9 +969,9 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { /** Asserts type of given tree is a subtype of given type. */ private boolean assertTreeSubTypeOf(Tree tree, Type expected) { global.nextPhase(); - assert tree.type().isSubType(expected): + assert tree.getType().isSubType(expected): "\ntree : " + tree + - "\ntype : " + tree.type() + + "\ntype : " + tree.getType() + "\nexpected: " + expected; global.prevPhase(); return true; @@ -1134,8 +1134,8 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { } public Tree Cons(int pos, Type elemtpe, Tree hd, Tree tl) { - assert hd.type().isSubType(elemtpe): elemtpe + " -- " + hd; - assert tl.type().isSubType(definitions.LIST_TYPE(elemtpe)): + assert hd.getType().isSubType(elemtpe): elemtpe + " -- " + hd; + assert tl.getType().isSubType(definitions.LIST_TYPE(elemtpe)): elemtpe + " -- " + tl; return New(mkPrimaryConstr(pos, global.definitions |