diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 6b85cec70d7a..7d2f265fe4c9 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -271,9 +271,14 @@ class ClassfileParser( * and make constructor type polymorphic in the type parameters of the class */ def normalizeConstructorInfo() = { - val mt @ MethodType(paramNames) = denot.info val rt = classRoot.typeRef appliedTo (classRoot.typeParams map (_.typeRef)) - denot.info = mt.derivedLambdaType(paramNames, mt.paramInfos, rt) + + def resultType(tpe: Type): Type = tpe match { + case mt @ MethodType(paramNames) => mt.derivedLambdaType(paramNames, mt.paramInfos, rt) + case pt : PolyType => pt.derivedLambdaType(pt.paramNames, pt.paramInfos, resultType(pt.resType)) + } + + denot.info = resultType(denot.info) addConstructorTypeParams(denot) } diff --git a/tests/run/i7990/Exception_1.java b/tests/run/i7990/Exception_1.java new file mode 100644 index 000000000000..6ee8500775ff --- /dev/null +++ b/tests/run/i7990/Exception_1.java @@ -0,0 +1,7 @@ +public class Exception_1 { + public Exception_1(T actual, T matcher) { + } + + public Exception_1(String message) { + } +} diff --git a/tests/run/i7990/Test_2.scala b/tests/run/i7990/Test_2.scala new file mode 100644 index 000000000000..baca4b8c4066 --- /dev/null +++ b/tests/run/i7990/Test_2.scala @@ -0,0 +1 @@ +@main def Test = Exception_1("error")