Skip to content

Commit

Permalink
More robust check for subsumes
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Oct 9, 2024
1 parent c20ae8f commit cb6605c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/cc/CaptureRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ trait CaptureRef extends TypeProxy, ValueType:

def viaInfo(info: Type)(test: Type => Boolean): Boolean = info.match
case info: SingletonCaptureRef => test(info)
case info: AndType => test(info.tp1) || test(info.tp2)
case info: OrType => test(info.tp1) && test(info.tp2)
case info: AndType => viaInfo(info.tp1)(test) || viaInfo(info.tp2)(test)
case info: OrType => viaInfo(info.tp1)(test) && viaInfo(info.tp2)(test)
case _ => false

(this eq y)
Expand All @@ -123,7 +123,7 @@ trait CaptureRef extends TypeProxy, ValueType:
this.subsumes(ypre)
|| this.match
case x @ TermRef(xpre: CaptureRef, _) if x.symbol == y.symbol =>
subsumingRefs(xpre, ypre) && subsumingRefs(ypre, xpre)
withMode(Mode.IgnoreCaptures) {TypeComparer.isSameRef(xpre, ypre)}
case _ =>
false
case _ => false
Expand Down

0 comments on commit cb6605c

Please sign in to comment.