Skip to content

Commit

Permalink
Update a comment in PatternTypeConstrainer
Browse files Browse the repository at this point in the history
  • Loading branch information
abgruszecki authored and bishabosha committed Oct 18, 2022
1 parent 5ed89ad commit f2ede4c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ trait PatternTypeConstrainer { self: TypeComparer =>
tyconS.typeParams.lazyZip(argsS).lazyZip(argsP).forall { (param, argS, argP) =>
val variance = param.paramVarianceSign
if variance == 0 || assumeInvariantRefinement ||
// heal the type if it's a (pattern-bound) type variable, provided we didn't upcast the pattern type:
// As a special case, when pattern and scrutinee types have the same type constructor,
// we infer better bounds for pattern-bound abstract types.
argP.typeSymbol.isPatternBound && patternTp.classSymbol == scrutineeTp.classSymbol
then
val TypeBounds(loS, hiS) = argS.bounds
Expand Down

0 comments on commit f2ede4c

Please sign in to comment.