summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-09-08 16:11:49 +0000
committerpaltherr <paltherr@epfl.ch>2003-09-08 16:11:49 +0000
commit52c7c8048593671851d8290623c8a290b20950a5 (patch)
tree857b21014930877efb80f5aa715a84b932646318 /sources
parente60924767e30c9447fc169e4658cee7bb76e63ef (diff)
downloadscala-52c7c8048593671851d8290623c8a290b20950a5.tar.gz
scala-52c7c8048593671851d8290623c8a290b20950a5.tar.bz2
scala-52c7c8048593671851d8290623c8a290b20950a5.zip
- Replaced some TypeApply+Apply by mkApply
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/ast/TreeGen.java19
1 files changed, 6 insertions, 13 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java
index d6f85f15f3..307a91336d 100644
--- a/sources/scalac/ast/TreeGen.java
+++ b/sources/scalac/ast/TreeGen.java
@@ -252,9 +252,7 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
infer.methodAlternative(
ref, alts, alttypes, Tree.typeOf(parentArgs), Type.AnyType);
}
- Tree constr = (args.length == 0) ? ref
- : TypeApply(ref, mkTypes(sym.pos, args));
- return Apply(constr, parentArgs);
+ return mkApply(ref, mkTypes(pos, args), parentArgs);
default:
throw global.fail("invalid parent type", parentType);
}
@@ -419,10 +417,7 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
public Tree New(int pos, Type pre, Symbol clazz,
Type[] targs, Tree[] args) {
Tree constr = mkRef(pos, pre, clazz.primaryConstructor());
- if (targs.length != 0)
- constr = TypeApply(constr, mkTypes(pos, targs));
- Tree base = Apply(constr, args);
- return New(base);
+ return New(mkApply(constr, mkTypes(pos, targs), args));
}
/** Build a monomorphic allocation new P.C(ARGS)
@@ -759,12 +754,10 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
clazz.info().members().enter(meth);
changeOwner(visitor, prevOwner, meth);
Tree body =
- Apply(
- TypeApply(
- Select(Ident(param), definitions.MATCH),
- new Tree[]{mkType(pos, pattype), mkType(pos, restype)}),
- new Tree[]{visitor})
- .setType(restype);
+ mkApply(
+ Select(Ident(param), definitions.MATCH),
+ new Tree[]{mkType(pos, pattype), mkType(pos, restype)},
+ new Tree[]{visitor});
return DefDef(meth, body);
}