summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2003-03-05 09:59:55 +0000
committerschinz <schinz@epfl.ch>2003-03-05 09:59:55 +0000
commit2afca5bd499aa28ff9d893b270cce4916f0b6d5a (patch)
tree14e05dcf73cc83640e9340fd251e25da0177e7a1 /sources
parent1956c530070b9ad3c75991ac90c2969081483c41 (diff)
downloadscala-2afca5bd499aa28ff9d893b270cce4916f0b6d5a.tar.gz
scala-2afca5bd499aa28ff9d893b270cce4916f0b6d5a.tar.bz2
scala-2afca5bd499aa28ff9d893b270cce4916f0b6d5a.zip
- bug fix: properly set owner of cloned method ...
- bug fix: properly set owner of cloned method symbols
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/transformer/AddInterfaces.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/sources/scalac/transformer/AddInterfaces.java b/sources/scalac/transformer/AddInterfaces.java
index 0b17d60f60..5715edb7b9 100644
--- a/sources/scalac/transformer/AddInterfaces.java
+++ b/sources/scalac/transformer/AddInterfaces.java
@@ -201,6 +201,7 @@ class AddInterfaces extends SubstTransformer {
}
protected Type cloneSymbolsInMethodType(Type type,
+ Symbol newOwner,
SymbolMapApplier smApplier,
Map symbolMap) {
switch (type) {
@@ -215,11 +216,13 @@ class AddInterfaces extends SubstTransformer {
Symbol[] newVParams = new Symbol[vparams.length];
for (int i = 0; i < vparams.length; ++i) {
newVParams[i] = vparams[i].cloneSymbol();
+ newVParams[i].setOwner(newOwner);
newVParams[i].setType(smApplier.apply(newVParams[i].info()));
symbolMap.put(vparams[i], newVParams[i]);
}
return new Type.MethodType(newVParams,
cloneSymbolsInMethodType(result,
+ newOwner,
smApplier,
symbolMap));
}
@@ -228,10 +231,12 @@ class AddInterfaces extends SubstTransformer {
Symbol[] newTParams = new Symbol[tparams.length];
for (int i = 0; i < tparams.length; ++i) {
newTParams[i] = tparams[i].cloneSymbol();
+ newTParams[i].setOwner(newOwner);
symbolMap.put(tparams[i], newTParams[i]);
}
return new Type.PolyType(newTParams,
cloneSymbolsInMethodType(result,
+ newOwner,
smApplier,
symbolMap));
}
@@ -354,16 +359,6 @@ class AddInterfaces extends SubstTransformer {
}
public Tree transform(Tree tree) {
- if (tree.hasSymbol()) {
- Symbol sym = tree.symbol();
- if (sym != Symbol.NONE) {
- Symbol owner = sym.owner();
- if (ifaceMemberToClass.containsKey(owner)) {
- sym.setOwner((Symbol)ifaceMemberToClass.get(owner));
- }
- }
- }
-
switch (tree) {
case ClassDef(int mods,
Name name,
@@ -702,6 +697,7 @@ class AddInterfaces extends SubstTransformer {
if (cSym.isMethod()) {
Map funSymMap = new HashMap();
Type newInfo = cloneSymbolsInMethodType(cSym.info(),
+ cSym,
tparamsSM,
funSymMap);
if (! funSymMap.isEmpty())