Skip to content

Commit 920bf44

Browse files
committed
Cleanup dead code
1 parent a8bc72a commit 920bf44

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,6 @@ object CheckCaptures:
142142

143143
private val seen = new EqHashSet[TypeRef]
144144

145-
/** Check that there is at least one method containing carrier and defined
146-
* in the scope of tparam. E.g. this is OK:
147-
* def f[T] = { ... var x: T ... }
148-
* So is this:
149-
* class C[T] { def f() = { class D { var x: T }}}
150-
* But this is not OK:
151-
* class C[T] { object o { var x: T }}
152-
*/
153-
extension (tparam: Symbol) def isParametricIn(carrier: Symbol): Boolean =
154-
carrier.exists && {
155-
val encl = carrier.owner.enclosingMethodOrClass
156-
if encl.isClass then tparam.isParametricIn(encl)
157-
else
158-
def recur(encl: Symbol): Boolean =
159-
if tparam.owner == encl then true
160-
else if encl.isStatic || !encl.exists then false
161-
else recur(encl.owner.enclosingMethodOrClass)
162-
recur(encl)
163-
}
164-
165145
def traverse(t: Type) =
166146
t.dealiasKeepAnnots match
167147
case t: TypeRef =>

0 commit comments

Comments
 (0)