File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed
compiler/src/dotty/tools/dotc/cc Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -285,16 +285,6 @@ extension (tp: Type)
285285 case tp1 : TypeRef if ! tp1.symbol.is(Param ) => tp1.prefix.pathRoot
286286 case tp1 => tp1
287287
288- /** The first element of a path type, but stop at references extending
289- * SharableCapability
290- */
291- final def pathRootOrShared (using Context ): Type =
292- if tp.derivesFrom(defn.Caps_SharedCapability ) then tp
293- else tp.dealias match
294- case tp1 : TermRef if tp1.symbol.maybeOwner.isClass => tp1.prefix.pathRoot
295- case tp1 : TypeRef if ! tp1.symbol.is(Param ) => tp1.prefix.pathRoot
296- case tp1 => tp1
297-
298288 /** If this part starts with `C.this`, the class `C`.
299289 * Otherwise, if it starts with a reference `r`, `r`'s owner.
300290 * Otherwise NoSymbol.
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ class SepChecker(checker: CheckCaptures.CheckerAPI) extends tpd.TreeTraverser:
410410 val badParams = mutable.ListBuffer [Symbol ]()
411411 def currentOwner = role.dclSym.orElse(ctx.owner)
412412 for hiddenRef <- prune(refsToCheck, tpe, role) do
413- val proot = hiddenRef.pathRootOrShared
413+ val proot = hiddenRef.pathRoot
414414 if ! proot.widen.derivesFrom(defn.Caps_SharedCapability ) then
415415 proot match
416416 case ref : TermRef =>
@@ -448,7 +448,7 @@ class SepChecker(checker: CheckCaptures.CheckerAPI) extends tpd.TreeTraverser:
448448 role match
449449 case _ : TypeRole .Argument | _ : TypeRole .Qualifier =>
450450 for ref <- refsToCheck do
451- if ! ref.pathRootOrShared. derivesFrom(defn.Caps_SharedCapability ) then
451+ if ! ref.derivesFrom(defn.Caps_SharedCapability ) then
452452 consumed.put(ref, pos)
453453 case _ =>
454454 end checkConsumedRefs
You can’t perform that action at this time.
0 commit comments