From 5dc50833450033d06f845bc7473808731a155f82 Mon Sep 17 00:00:00 2001 From: paltherr Date: Tue, 6 Apr 2004 08:52:16 +0000 Subject: - Added Tree.Create --- sources/scalac/atree/ATreeFromSTree.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'sources/scalac/atree') 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: -- cgit v1.2.3