@@ -1094,14 +1094,17 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
10941094 {
10951095 implicit val ctx = nestedCtx
10961096
1097- // Fully define the type so that the types of the tparams created
1098- // below never contain TypeRefs whose underling types contain
1099- // uninstantiated TypeVars, this could lead to cycles in `isSubType`
1100- // as a TypeVar might get constrained by a TypeRef it's part of.
1101- val tp1a = fullyDefinedType(tp1, " alternative" , alt1.symbol.pos).asInstanceOf [PolyType ]
1102-
1103- val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags , tp1a.instantiateBounds)
1104- isAsSpecific(alt1, tp1a.instantiate(tparams.map(_.typeRef)), alt2, tp2)
1097+
1098+ // Fully define the PolyType parameters so that the infos of the
1099+ // tparams created below never contain TypeRefs whose underling types
1100+ // contain uninstantiated TypeVars, this could lead to cycles in
1101+ // `isSubType` as a TypeVar might get constrained by a TypeRef it's
1102+ // part of.
1103+ val tp1Params = tp1.newLikeThis(tp1.paramNames, tp1.paramInfos, defn.AnyType )
1104+ fullyDefinedType(tp1Params, " type parameters of alternative" , alt1.symbol.pos).asInstanceOf [PolyType ]
1105+
1106+ val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags , tp1.instantiateBounds)
1107+ isAsSpecific(alt1, tp1.instantiate(tparams.map(_.typeRef)), alt2, tp2)
11051108 }
11061109 case _ => // (3)
11071110 tp2 match {
0 commit comments