diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 0be68b119d40..9128b1f11e45 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -2857,14 +2857,19 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling tp case tp: HKTypeLambda => tp + case tp: ParamRef => + val st = tp.superTypeNormalized + if st.exists then + disjointnessBoundary(st) + else + // workaround for when ParamRef#underlying returns NoType + defn.AnyType case tp: TypeProxy => disjointnessBoundary(tp.superTypeNormalized) case tp: WildcardType => disjointnessBoundary(tp.effectiveBounds.hi) case tp: ErrorType => defn.AnyType - case NoType => // ParamRef#superTypeNormalized can return NoType - defn.AnyType end disjointnessBoundary (disjointnessBoundary(tp1), disjointnessBoundary(tp2)) match