@@ -148,7 +148,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
148
148
private def paramCount (entries : Array [Type ]) = entries.length >> 1
149
149
150
150
/** 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 =
152
152
entries(paramCount(entries) + n)
153
153
154
154
/** The `boundsMap` entry corresponding to `param` */
@@ -171,7 +171,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
171
171
val origin = tvar.origin
172
172
val entries = boundsMap(origin.binder)
173
173
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)
175
175
}
176
176
177
177
// ---------- Dependency handling ----------------------------------------------
@@ -203,11 +203,13 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
203
203
def nonParamBounds (param : TypeParamRef )(using Context ): TypeBounds =
204
204
entry(param).bounds
205
205
206
- def typeVarOfParam (param : TypeParamRef ): Type = {
206
+ def typeVarOfParam (param : TypeParamRef ): Type =
207
207
val entries = boundsMap(param.binder)
208
208
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
211
213
212
214
// ---------- Adding TypeLambdas --------------------------------------------------
213
215
0 commit comments