diff options
author | paltherr <paltherr@epfl.ch> | 2003-11-05 11:59:41 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-11-05 11:59:41 +0000 |
commit | d172e5ef70e88872641f78652b94829a98b985a8 (patch) | |
tree | bd659cb00b36efcbcf726f439dcbf034e5093118 /sources/scalac/symtab | |
parent | 412f0dee7e30a1c95c88d6dd02b55de72a4230f3 (diff) | |
download | scala-d172e5ef70e88872641f78652b94829a98b985a8.tar.gz scala-d172e5ef70e88872641f78652b94829a98b985a8.tar.bz2 scala-d172e5ef70e88872641f78652b94829a98b985a8.zip |
- Added method setParamOwners to fix owners of ...
- Added method setParamOwners to fix owners of MethodType and PolyType
params
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r-- | sources/scalac/symtab/classfile/ClassfileParser.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sources/scalac/symtab/classfile/ClassfileParser.java b/sources/scalac/symtab/classfile/ClassfileParser.java index 8c2ed2f67c..6f36a00382 100644 --- a/sources/scalac/symtab/classfile/ClassfileParser.java +++ b/sources/scalac/symtab/classfile/ClassfileParser.java @@ -211,11 +211,12 @@ public class ClassfileParser implements ClassfileConstants { default: throw new ApplicationError(); } - s.setFirstInfo(type); - attrib.readAttributes(s, type, METH_ATTR); Symbol constr = c.primaryConstructor(); if (constr.isInitialized()) constr = c.addConstructor(); s.copyTo(constr); + setParamOwners(type, constr); + constr.setFirstInfo(type); + attrib.readAttributes(constr, type, METH_ATTR); //System.out.println(c + " " + c.allConstructors() + ":" + c.allConstructors().info());//debug //System.out.println("-- enter " + s); } else { @@ -223,9 +224,23 @@ public class ClassfileParser implements ClassfileConstants { Position.NOPOS, name, ((flags & 0x0008) != 0) ? c.module().moduleClass() : c, transFlags(flags)); + setParamOwners(type, s); s.setFirstInfo(type); attrib.readAttributes(s, type, METH_ATTR); ((flags & 0x0008) != 0 ? statics : locals).enterOrOverload(s); } } + + private void setParamOwners(Type type, Symbol owner) { + switch (type) { + case PolyType(Symbol[] params, Type result): + for (int i = 0; i < params.length; i++) params[i].setOwner(owner); + setParamOwners(result, owner); + return; + case MethodType(Symbol[] params, Type result): + for (int i = 0; i < params.length; i++) params[i].setOwner(owner); + setParamOwners(result, owner); + return; + } + } } |