Skip to content

Commit 40edbd0

Browse files
committed
Fix #7990: handle PolyType in constructor normalization
1 parent d74a18a commit 40edbd0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,14 @@ class ClassfileParser(
271271
* and make constructor type polymorphic in the type parameters of the class
272272
*/
273273
def normalizeConstructorInfo() = {
274-
val mt @ MethodType(paramNames) = denot.info
275274
val rt = classRoot.typeRef appliedTo (classRoot.typeParams map (_.typeRef))
276-
denot.info = mt.derivedLambdaType(paramNames, mt.paramInfos, rt)
275+
276+
def resultType(tpe: Type): Type = tpe match {
277+
case mt @ MethodType(paramNames) => mt.derivedLambdaType(paramNames, mt.paramInfos, rt)
278+
case pt : PolyType => pt.derivedLambdaType(pt.paramNames, pt.paramInfos, resultType(pt.resType))
279+
}
280+
281+
denot.info = resultType(denot.info)
277282
addConstructorTypeParams(denot)
278283
}
279284

0 commit comments

Comments
 (0)