Skip to content

Commit 5453d5c

Browse files
dwijnandKordyjan
authored andcommitted
GADT: Use isPatternBound, ofc...
1 parent 4cc0e0d commit 5453d5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class GadtConstraint private (
8383
// B$2 had info <: B$1 and fullBounds <: B$1
8484
// We can use the info of B$2 to drop the lower-bound of B$1
8585
// and return non-bidirectional bounds B$1 <: X and B$2 <: B$1.
86-
if tp.name.is(UniqueName) && !tp.info.hiBound.isExactlyAny && self <:< tp.info.hiBound => acc
86+
if tp.symbol.isPatternBound && !tp.info.hiBound.isExactlyAny && self <:< tp.info.hiBound => acc
8787
case tp => acc | tp
8888
}
8989

@@ -92,7 +92,7 @@ class GadtConstraint private (
9292
constraint.minUpper(param).foldLeft(nonParamBounds(param).hi) { (acc, u) =>
9393
externalize(u) match
9494
case tp: TypeRef // same as fullLowerBounds
95-
if tp.name.is(UniqueName) && !tp.info.loBound.isExactlyNothing && tp.info.loBound <:< self => acc
95+
if tp.symbol.isPatternBound && !tp.info.loBound.isExactlyNothing && tp.info.loBound <:< self => acc
9696
case tp =>
9797
// Any as the upper bound means "no bound", but if F is higher-kinded,
9898
// Any & F = F[_]; this is wrong for us so we need to short-circuit

0 commit comments

Comments
 (0)