Skip to content

Commit 3c92ecd

Browse files
committed
Typer#escapingRefs: remove dead code
1 parent 8ed77f4 commit 3c92ecd

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
450450
}
451451

452452
def escapingRefs(block: Tree, localSyms: => List[Symbol])(implicit ctx: Context): collection.Set[NamedType] = {
453-
var hoisted: Set[Symbol] = Set()
454453
lazy val locals = localSyms.toSet
455-
def leakingTypes(tp: Type): collection.Set[NamedType] =
456-
tp namedPartsWith (tp => locals.contains(tp.symbol))
457-
def typeLeaks(tp: Type): Boolean = leakingTypes(tp).nonEmpty
458-
def classLeaks(sym: ClassSymbol): Boolean =
459-
(ctx.owner is Method) || // can't hoist classes out of method bodies
460-
(sym.info.parents exists typeLeaks) ||
461-
(sym.info.decls.toList exists (t => typeLeaks(t.info)))
462-
leakingTypes(block.tpe)
454+
block.tpe namedPartsWith (tp => locals.contains(tp.symbol))
463455
}
464456

465457
/** Check that expression's type can be expressed without references to locally defined

0 commit comments

Comments
 (0)