summaryrefslogtreecommitdiff
path: root/sources/scalac/transformer/AddInterfaces.java
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2003-10-27 15:14:24 +0000
committerschinz <schinz@epfl.ch>2003-10-27 15:14:24 +0000
commit3e967ea8a6b7a80f6077e3e7f292ce8c2e01a51c (patch)
tree51b620f9af907ed5894155b4ab996d3ef89c217e /sources/scalac/transformer/AddInterfaces.java
parent36cde37b4aef5a1b4e2a0dc2554aafc0fece681e (diff)
downloadscala-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
Diffstat (limited to 'sources/scalac/transformer/AddInterfaces.java')
-rw-r--r--sources/scalac/transformer/AddInterfaces.java12
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));
}