Skip to content

Commit

Permalink
Merge pull request #9616 from dotty-staging/harden-constraints
Browse files Browse the repository at this point in the history
Harden constraints so bounds can only be value types or lambdas
  • Loading branch information
odersky committed Aug 21, 2020
2 parents 1fb07cb + d26f1f4 commit 387c562
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 387c562

Please sign in to comment.