diff options
author | schinz <schinz@epfl.ch> | 2003-10-27 15:14:24 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2003-10-27 15:14:24 +0000 |
commit | 3e967ea8a6b7a80f6077e3e7f292ce8c2e01a51c (patch) | |
tree | 51b620f9af907ed5894155b4ab996d3ef89c217e | |
parent | 36cde37b4aef5a1b4e2a0dc2554aafc0fece681e (diff) | |
download | scala-3e967ea8a6b7a80f6077e3e7f292ce8c2e01a51c.tar.gz scala-3e967ea8a6b7a80f6077e3e7f292ce8c2e01a51c.tar.bz2 scala-3e967ea8a6b7a80f6077e3e7f292ce8c2e01a51c.zip |
- bug fix: "new" should now be translated corre...
- bug fix: "new" should now be translated correctly even for classes
which have an explicit type given
-rw-r--r-- | sources/scalac/transformer/AddInterfaces.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sources/scalac/transformer/AddInterfaces.java b/sources/scalac/transformer/AddInterfaces.java index b2f61cfa1c..d6a4727ef7 100644 --- a/sources/scalac/transformer/AddInterfaces.java +++ b/sources/scalac/transformer/AddInterfaces.java @@ -240,15 +240,8 @@ class AddInterfaces extends Transformer { case New(Template templ): { Tree.New newTree = (Tree.New)super.transform(tree); - Type tp = newTree.type; - /* - switch (tp) { - case CompoundType(Type[] parts, _): tp = parts[0]; - // gross hack to prevent crashing when selftypes are compound; - // should be fixed! - } - */ - Symbol ifaceSym = tp.unalias().symbol(); + Tree.Apply parent = (Tree.Apply)newTree.templ.parents[0]; + Symbol ifaceSym = TreeInfo.methSymbol(parent).type().resultType().symbol(); if (phase.needInterface(ifaceSym)) { Map clsMap = new HashMap(); Symbol classSym = phase.getClassSymbol(ifaceSym); @@ -260,7 +253,6 @@ class AddInterfaces extends Transformer { newTree.setType(clsSubst.apply(newTree.type)); newTree.templ.setType(clsSubst.apply(newTree.templ.type)); - Tree.Apply parent = (Tree.Apply)newTree.templ.parents[0]; parent.setType(clsSubst.apply(parent.type)); parent.fun.setType(clsSubst.apply(parent.fun.type)); } |