@@ -4,7 +4,7 @@ package transform
44import util .Positions ._
55import MegaPhase .MiniPhase
66import core ._
7- import Contexts .Context , Types ._ , Decorators ._ , Symbols ._ , typer ._
7+ import Contexts .Context , Types ._ , Decorators ._ , Symbols ._ , typer ._ , ast . _
88import TypeUtils ._ , Flags ._
99import config .Printers .{ transforms => debug }
1010
@@ -51,8 +51,8 @@ object Checkable {
5151 * 4. if `P = Array[T]`, checkable(E, T) where `E` is the element type of `X`, defaults to `Any`.
5252 * 5. if `P` is `pre.F[Ts]` and `pre.F` refers to a class which is not `Array`:
5353 * (a) replace `Ts` with fresh type variables `Xs`
54- * (b) instantiate `Xs` with the constraint ` pre.F[Xs] <:< X`
55- * (c) `pre.F[Xs ] <:< P`
54+ * (b) ` pre.F[Xs] <:< X` with `Xs` instantiated as `Es `
55+ * (c) `pre.F[Es ] <:< P`
5656 * 6. if `P = T1 | T2` or `P = T1 & T2`, checkable(X, T1) && checkable(X, T2).
5757 * 7. if `P` is a refinement type, FALSE
5858 * 8. otherwise, TRUE
@@ -72,13 +72,14 @@ object Checkable {
7272
7373 def isClassDetermined (X : Type , P : AppliedType )(implicit ctx : Context ) = {
7474 val AppliedType (tycon, _) = P
75- val tvars = tycon.typeParams.map { tparam => newTypeVar(tparam.paramInfo.bounds) }
75+ val typeLambda = tycon.ensureHK.asInstanceOf [TypeLambda ]
76+ val tvars = constrained(typeLambda, untpd.EmptyTree , alwaysAddTypeVars = true )._2.map(_.tpe)
7677 val P1 = tycon.appliedTo(tvars)
7778
7879 debug.println(" P1 : " + P1 .show)
7980 debug.println(" X : " + X .show)
8081
81- ! (P1 <:< X ) || {
82+ (P1 <:< X ) && {
8283 val res = isFullyDefined(P1 , ForceDegree .noBottom) && P1 <:< P
8384 debug.println(" P1 <:< P = " + res)
8485 res
0 commit comments