summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-09-08 15:27:09 +0000
committerpaltherr <paltherr@epfl.ch>2003-09-08 15:27:09 +0000
commit78c05c5995589a661f0ac5c6ec9376a122412a61 (patch)
tree6abb5d46f082fe4bbb98cf141cf074337ce4e43b /sources
parente9a7b01df14b8f21bcf9cc0665a6d4c62a91431f (diff)
downloadscala-78c05c5995589a661f0ac5c6ec9376a122412a61.tar.gz
scala-78c05c5995589a661f0ac5c6ec9376a122412a61.tar.bz2
scala-78c05c5995589a661f0ac5c6ec9376a122412a61.zip
- Updated the code that transforms interface co...
- Updated the code that transforms interface constructors
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/transformer/AddInterfacesPhase.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/sources/scalac/transformer/AddInterfacesPhase.java b/sources/scalac/transformer/AddInterfacesPhase.java
index cb42bc15fd..ca3342a86b 100644
--- a/sources/scalac/transformer/AddInterfacesPhase.java
+++ b/sources/scalac/transformer/AddInterfacesPhase.java
@@ -136,10 +136,8 @@ public class AddInterfacesPhase extends Phase {
return new Type.MethodType(Symbol.EMPTY_ARRAY, result);
case PolyType(Symbol[] tps, Type result):
return new Type.PolyType(tps, removeValueParams(result));
- case OverloadedType(_, Type[] altTypes):
- return removeValueParams(altTypes[0]);
default:
- return tp;
+ throw Debug.abort("illegal case", tp);
}
}
@@ -209,6 +207,15 @@ public class AddInterfacesPhase extends Phase {
classSym.name = className(ifaceSym.name);
classSym.flags &= ~Modifiers.INTERFACE;
+ // Remove non-primary constructors from interface
+ if (ifaceSym.allConstructors().isOverloaded()) {
+ Symbol primary = ifaceSym.primaryConstructor();
+ Symbol[] altsyms = { primary };
+ Type[] alttypes = { primary.nextType() };
+ Type allType = Type.OverloadedType(altsyms, alttypes);
+ ifaceSym.allConstructors().updateInfo(allType);
+ }
+
Scope ifaceOwnerMembers = ifaceSym.owner().members();
ifaceOwnerMembers.enter(classSym);