diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index 27949f3fb899..91d6b2c7fbf2 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -484,6 +484,7 @@ trait ConstraintHandling { * way isSubType is organized. */ protected def addConstraint(param: TypeParamRef, bound: Type, fromBelow: Boolean)(using Context): Boolean = + if !bound.isValueTypeOrLambda then return false /** When comparing lambdas we might get constraints such as * `A <: X0` or `A = List[X0]` where `A` is a constrained parameter