diff options
Diffstat (limited to 'sources/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rwxr-xr-x | sources/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sources/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/sources/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 38cebbe26c..8554452376 100755 --- a/sources/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/sources/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -176,9 +176,12 @@ abstract class ClassfileParser { private def sigToType(name: Name): Type = { var index = 0; val end = name.length; + def objToAny(tp: Type): Type = + if (tp.symbol == definitions.ObjectClass) definitions.AnyClass.tpe + else tp; def paramsigs2types: List[Type] = if (name(index) == ')') { index = index + 1; List() } - else sig2type :: paramsigs2types; + else objToAny(sig2type) :: paramsigs2types; def sig2type: Type = { val tag = name(index); index = index + 1; tag match { @@ -240,6 +243,12 @@ abstract class ClassfileParser { for (val i <- Iterator.range(0, fieldCount)) parseField(); val methodCount = in.nextChar(); for (val i <- Iterator.range(0, methodCount)) parseMethod(); + if (instanceDefs.lookup(nme.CONSTRUCTOR) == NoSymbol && (sflags & INTERFACE) == 0) { + System.out.println("adding constructor to " + clazz);//debug + instanceDefs enter + clazz.newConstructor(Position.NOPOS) + .setFlag(clazz.flags & CONSTRFLAGS).setInfo(MethodType(List(), clazz.tpe)); + } } } |