@@ -101,7 +101,7 @@ trait CaptureRef extends TypeProxy, ValueType:
101101   *   TODO: Document path cases 
102102   */  
103103  final  def  subsumes (y : CaptureRef )(using  Context ):  Boolean  = 
104- 
104+      
105105    def  subsumingRefs (x : Type , y : Type ):  Boolean  =  x match 
106106      case  x : CaptureRef  =>  y match 
107107        case  y : CaptureRef  =>  x.subsumes(y)
@@ -135,13 +135,21 @@ trait CaptureRef extends TypeProxy, ValueType:
135135              case  _ =>  false 
136136          ||  viaInfo(y.info)(subsumingRefs(this , _))
137137        case  MaybeCapability (y1) =>  this .stripMaybe.subsumes(y1)
138+         case  y : TypeRef  if  y.symbol.info.derivesFrom(defn.Caps_CapSet ) => 
139+           y.info match 
140+             case  _ : TypeAlias  =>  y.captureSetOfInfo.elems.exists(this .subsumes)
141+             case  TypeBounds (_, hi : CaptureRef ) =>  this .subsumes(hi)
142+             case  _ =>  false 
138143        case  _ =>  false 
139144    ||  this .match 
140145        case  ReachCapability (x1) =>  x1.subsumes(y.stripReach)
141146        case  x : TermRef  =>  viaInfo(x.info)(subsumingRefs(_, y))
142147        case  x : TermParamRef  =>  subsumesExistentially(x, y)
143148        case  x : TypeRef  if  x.symbol.info.derivesFrom(defn.Caps_CapSet ) => 
144-           x.captureSetOfInfo.elems.exists(_.subsumes(y))
149+           x.info match 
150+             case  _ : TypeAlias  =>  x.captureSetOfInfo.elems.exists(_.subsumes(y))
151+             case  TypeBounds (lo : CaptureRef , _) =>  lo.subsumes(y)
152+             case  _ =>  false 
145153        case  x : TypeRef  =>  assumedContainsOf(x).contains(y)
146154        case  _ =>  false 
147155  end  subsumes 
0 commit comments