Skip to content

Commit cb6605c

Browse files
committed
More robust check for subsumes
1 parent c20ae8f commit cb6605c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureRef.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ trait CaptureRef extends TypeProxy, ValueType:
110110

111111
def viaInfo(info: Type)(test: Type => Boolean): Boolean = info.match
112112
case info: SingletonCaptureRef => test(info)
113-
case info: AndType => test(info.tp1) || test(info.tp2)
114-
case info: OrType => test(info.tp1) && test(info.tp2)
113+
case info: AndType => viaInfo(info.tp1)(test) || viaInfo(info.tp2)(test)
114+
case info: OrType => viaInfo(info.tp1)(test) && viaInfo(info.tp2)(test)
115115
case _ => false
116116

117117
(this eq y)
@@ -123,7 +123,7 @@ trait CaptureRef extends TypeProxy, ValueType:
123123
this.subsumes(ypre)
124124
|| this.match
125125
case x @ TermRef(xpre: CaptureRef, _) if x.symbol == y.symbol =>
126-
subsumingRefs(xpre, ypre) && subsumingRefs(ypre, xpre)
126+
withMode(Mode.IgnoreCaptures) {TypeComparer.isSameRef(xpre, ypre)}
127127
case _ =>
128128
false
129129
case _ => false

0 commit comments

Comments
 (0)