Skip to content

Commit f13fe71

Browse files
committed
Typer#escapingRefs: remove dead code
1 parent e7dc46f commit f13fe71

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
@@ -515,16 +515,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
515515
}
516516

517517
def escapingRefs(block: Tree, localSyms: => List[Symbol])(implicit ctx: Context): collection.Set[NamedType] = {
518-
var hoisted: Set[Symbol] = Set()
519518
lazy val locals = localSyms.toSet
520-
def leakingTypes(tp: Type): collection.Set[NamedType] =
521-
tp namedPartsWith (tp => locals.contains(tp.symbol))
522-
def typeLeaks(tp: Type): Boolean = leakingTypes(tp).nonEmpty
523-
def classLeaks(sym: ClassSymbol): Boolean =
524-
(ctx.owner is Method) || // can't hoist classes out of method bodies
525-
(sym.info.parents exists typeLeaks) ||
526-
(sym.info.decls.toList exists (t => typeLeaks(t.info)))
527-
leakingTypes(block.tpe)
519+
block.tpe namedPartsWith (tp => locals.contains(tp.symbol))
528520
}
529521

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

0 commit comments

Comments
 (0)