Skip to content

Commit 756ba3d

Browse files
committed
Tweak logic for hk type comparisons
1 parent 1054624 commit 756ba3d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,10 +726,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
726726

727727
tycon2 match {
728728
case param2: TypeParamRef =>
729-
isMatchingApply(tp1) || {
730-
if (canConstrain(param2)) canInstantiate(param2)
731-
else compareLower(bounds(param2), tyconIsTypeRef = false)
732-
}
729+
isMatchingApply(tp1) ||
730+
canConstrain(param2) && canInstantiate(param2) ||
731+
compareLower(bounds(param2), tyconIsTypeRef = false)
733732
case tycon2: TypeRef =>
734733
isMatchingApply(tp1) ||
735734
compareLower(tycon2.info.bounds, tyconIsTypeRef = true)

0 commit comments

Comments
 (0)