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