@@ -1094,14 +1094,17 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1094
1094
{
1095
1095
implicit val ctx = nestedCtx
1096
1096
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)
1105
+
1106
+ val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags , tp1.instantiateBounds)
1107
+ isAsSpecific(alt1, tp1.instantiate(tparams.map(_.typeRef)), alt2, tp2)
1105
1108
}
1106
1109
case _ => // (3)
1107
1110
tp2 match {
0 commit comments