@@ -148,7 +148,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
148148 private def paramCount (entries : Array [Type ]) = entries.length >> 1
149149
150150 /** The type variable corresponding to parameter numbered `n`, null if none was created */
151- private def typeVar (entries : Array [Type ], n : Int ): Type =
151+ private def typeVar (entries : Array [Type ], n : Int ): Type | Null =
152152 entries(paramCount(entries) + n)
153153
154154 /** The `boundsMap` entry corresponding to `param` */
@@ -171,7 +171,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
171171 val origin = tvar.origin
172172 val entries = boundsMap(origin.binder)
173173 val pnum = origin.paramNum
174- entries != null && isBounds(entries(pnum)) && (typeVar(entries, pnum) eq tvar)
174+ entries != null && isBounds(entries(pnum)) && (typeVar(entries, pnum) eqn tvar)
175175 }
176176
177177// ---------- Dependency handling ----------------------------------------------
@@ -203,11 +203,13 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
203203 def nonParamBounds (param : TypeParamRef )(using Context ): TypeBounds =
204204 entry(param).bounds
205205
206- def typeVarOfParam (param : TypeParamRef ): Type = {
206+ def typeVarOfParam (param : TypeParamRef ): Type =
207207 val entries = boundsMap(param.binder)
208208 if entries == null then NoType
209- else typeVar(entries, param.paramNum)
210- }
209+ else
210+ val tvar = typeVar(entries, param.paramNum)
211+ if tvar == null then NoType
212+ else tvar
211213
212214// ---------- Adding TypeLambdas --------------------------------------------------
213215
0 commit comments