summaryrefslogtreecommitdiff
path: root/sources/scalac/atree
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-04-06 08:52:16 +0000
committerpaltherr <paltherr@epfl.ch>2004-04-06 08:52:16 +0000
commit5dc50833450033d06f845bc7473808731a155f82 (patch)
tree79a532329ec0350504285ecc00decb3b7c16a045 /sources/scalac/atree
parent43505887a331fbf647ba39a85bdf16c321ce8037 (diff)
downloadscala-5dc50833450033d06f845bc7473808731a155f82.tar.gz
scala-5dc50833450033d06f845bc7473808731a155f82.tar.bz2
scala-5dc50833450033d06f845bc7473808731a155f82.zip
- Added Tree.Create
Diffstat (limited to 'sources/scalac/atree')
-rw-r--r--sources/scalac/atree/ATreeFromSTree.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/sources/scalac/atree/ATreeFromSTree.java b/sources/scalac/atree/ATreeFromSTree.java
index c092280d70..65d5bb5357 100644
--- a/sources/scalac/atree/ATreeFromSTree.java
+++ b/sources/scalac/atree/ATreeFromSTree.java
@@ -227,8 +227,13 @@ public class ATreeFromSTree {
case Throw(Tree value):
return make.Throw(tree, expression(value));
- case New(Tree init):
- return expression(init);
+ case New(Apply(Tree fun, Tree[] vargs)):
+ switch (fun) {
+ case Select(Create(_, Tree[] targs), _):
+ return apply(tree, fun, targs, vargs);
+ default:
+ throw Debug.abort("illegal case", tree);
+ }
case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] vargs):
return apply(tree, fun, targs, vargs);
@@ -280,14 +285,16 @@ public class ATreeFromSTree {
Symbol symbol = tree.symbol();
switch (tree) {
+ case Select(Create(_, _), _):
+ AInvokeStyle style = AInvokeStyle.New;
+ return AFunction.Method(make.Void, symbol, style);
+
case Select(Tree qualifier, _):
AInvokeStyle style = invokeStyle(qualifier);
return AFunction.Method(expression(qualifier), symbol, style);
case Ident(_):
- AInvokeStyle style = symbol.isInitializer()
- ? AInvokeStyle.New
- : AInvokeStyle.StaticClass;
+ AInvokeStyle style = AInvokeStyle.StaticClass;
return AFunction.Method(make.Void, symbol, style);
default: