Skip to content

Commit

Permalink
Cleanup dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
Linyxus committed Feb 15, 2024
1 parent a8bc72a commit 920bf44
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,6 @@ object CheckCaptures:

private val seen = new EqHashSet[TypeRef]

/** Check that there is at least one method containing carrier and defined
* in the scope of tparam. E.g. this is OK:
* def f[T] = { ... var x: T ... }
* So is this:
* class C[T] { def f() = { class D { var x: T }}}
* But this is not OK:
* class C[T] { object o { var x: T }}
*/
extension (tparam: Symbol) def isParametricIn(carrier: Symbol): Boolean =
carrier.exists && {
val encl = carrier.owner.enclosingMethodOrClass
if encl.isClass then tparam.isParametricIn(encl)
else
def recur(encl: Symbol): Boolean =
if tparam.owner == encl then true
else if encl.isStatic || !encl.exists then false
else recur(encl.owner.enclosingMethodOrClass)
recur(encl)
}

def traverse(t: Type) =
t.dealiasKeepAnnots match
case t: TypeRef =>
Expand Down

0 comments on commit 920bf44

Please sign in to comment.