diff options
author | Martin Odersky <odersky@gmail.com> | 2003-03-31 08:29:52 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-03-31 08:29:52 +0000 |
commit | efd06d74f1621351c70456478b07a4ace6a9a211 (patch) | |
tree | 01ac7505ed4f33582974d4519dc3e33d601614d2 /sources/scalac/ast/TreeGen.java | |
parent | 85c73ba918913361f925c23469c012096a93fb54 (diff) | |
download | scala-efd06d74f1621351c70456478b07a4ace6a9a211.tar.gz scala-efd06d74f1621351c70456478b07a4ace6a9a211.tar.bz2 scala-efd06d74f1621351c70456478b07a4ace6a9a211.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/ast/TreeGen.java')
-rw-r--r-- | sources/scalac/ast/TreeGen.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java index 0c9c47eb88..ecb4705de5 100644 --- a/sources/scalac/ast/TreeGen.java +++ b/sources/scalac/ast/TreeGen.java @@ -165,13 +165,7 @@ public class TreeGen implements Kinds, Modifiers { Tree ref = mkRef(pos, pre, sym.constructor()); Tree constr = (args.length == 0) ? ref : TypeApply(ref, mkTypes(sym.pos, args)); - switch (parentType) { - case MethodType(Symbol[] params, Type restpe): - assert params.length == 0 : parentType; - return Apply(constr, Tree.EMPTY_ARRAY); - default: - return constr; - } + return Apply(constr, Tree.EMPTY_ARRAY); default: throw global.fail("invalid parent type", parentType); } @@ -357,9 +351,17 @@ public class TreeGen implements Kinds, Modifiers { return TypeApply(fn.pos, fn, args); } + public Tree If(int pos, Tree cond, Tree thenpart, Tree elsepart) { + return + make.If(pos, cond, thenpart, elsepart).setType(thenpart.type); + } + + public Tree If(Tree cond, Tree thenpart, Tree elsepart) { + return If(cond.pos, cond, thenpart, elsepart); + } + /** Build and applied type node with given function * and argument trees. - */ public Tree AppliedType(int pos, Tree fn, Tree[] args) { return make.AppliedType(pos, fn, args) .setType(Type.appliedType(fn.type, Tree.typeOf(args))); @@ -368,6 +370,7 @@ public class TreeGen implements Kinds, Modifiers { public Tree AppliedType(Tree fn, Tree[] args) { return AppliedType(fn.pos, fn, args); } + */ /** Build and attribute select node of given symbol. * It is assumed that the prefix is not empty. |