@@ -58,8 +58,7 @@ object Checkable {
5858 * 4. if `P = Array[T]`, checkable(E, T) where `E` is the element type of `X`, defaults to `Any`.
5959 * 5. if `P` is `pre.F[Ts]` and `pre.F` refers to a class which is not `Array`:
6060 * (a) replace `Ts` with fresh type variables `Xs`
61- * (b) constrain `Xs` with `pre.F[Xs] <:< X`,
62- * if `X` cannot be uniquely determined, instantiate `X` with fresh type symbol.
61+ * (b) constrain `Xs` with `pre.F[Xs] <:< X`
6362 * (c) instantiate Xs and check `pre.F[Xs] <:< P`
6463 * 6. if `P = T1 | T2` or `P = T1 & T2`, checkable(X, T1) && checkable(X, T2).
6564 * 7. if `P` is a refinement type, FALSE
@@ -101,26 +100,7 @@ object Checkable {
101100
102101 P1 <:< X // may fail, ignore
103102
104- // 3324g.scala cannot happen in such cases
105- def canInstantiate =
106- tycon.classSymbol.is(Final ) ||
107- ! X .classSymbol.is(Trait ) ||
108- X .classSymbol.typeParams.isEmpty
109-
110- if (canInstantiate)
111- maximizeType(P1 , pos, fromScala2x = true ) // use `fromScala2x = true` to force instantiate invariant tvars
112- else
113- tvars.foreach { case tvar : TypeVar =>
114- val bounds = ctx.typerState.constraint.entry(tvar.origin)
115- if (bounds.loBound =:= bounds.hiBound)
116- tvar.instantiateWith(bounds.loBound)
117- else { // 3324g.scala
118- val wildCard = ctx.newSymbol(ctx.owner, WildcardParamName .fresh().toTypeName, Case , tvar.origin.underlying, coord = pos)
119- tvar.instantiateWith(wildCard.typeRef)
120- }
121- }
122-
123- val res = P1 <:< P
103+ val res = isFullyDefined(P1 , ForceDegree .noBottom) && P1 <:< P
124104 debug.println(" P1 : " + P1 )
125105 debug.println(" P1 <:< P = " + res)
126106
0 commit comments