@@ -1094,14 +1094,16 @@ 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
+ // Fully define the PolyType parameters so that the infos of the
1098
+ // tparams created below never contain TypeRefs whose underling types
1099
+ // contain uninstantiated TypeVars, this could lead to cycles in
1100
+ // `isSubType` as a TypeVar might get constrained by a TypeRef it's
1101
+ // part of.
1102
+ val tp1Params = tp1.newLikeThis(tp1.paramNames, tp1.paramInfos, defn.AnyType )
1103
+ fullyDefinedType(tp1Params, " type parameters of alternative" , alt1.symbol.pos)
1104
+
1105
+ val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags , tp1.instantiateBounds)
1106
+ isAsSpecific(alt1, tp1.instantiate(tparams.map(_.typeRef)), alt2, tp2)
1105
1107
}
1106
1108
case _ => // (3)
1107
1109
tp2 match {
0 commit comments