Skip to content

Commit 387c562

Browse files
authored
Merge pull request #9616 from dotty-staging/harden-constraints
Harden constraints so bounds can only be value types or lambdas
2 parents 1fb07cb + d26f1f4 commit 387c562

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

+1
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ trait ConstraintHandling {
484484
* way isSubType is organized.
485485
*/
486486
protected def addConstraint(param: TypeParamRef, bound: Type, fromBelow: Boolean)(using Context): Boolean =
487+
if !bound.isValueTypeOrLambda then return false
487488

488489
/** When comparing lambdas we might get constraints such as
489490
* `A <: X0` or `A = List[X0]` where `A` is a constrained parameter

0 commit comments

Comments
 (0)