aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-08-05 22:45:52 +0200
committerGuillaume Martres <smarter@ubuntu.com>2016-03-24 16:22:11 +0100
commitf13fe7147ddf8d527df855b1dfa0db4ae22107bb (patch)
tree951e609bffc205ef40d2e570cf21c5167e5a3860 /src/dotty/tools/dotc/typer/Typer.scala
parente7dc46fc2ee685708af566a78fa97f7faccd5dcd (diff)
downloaddotty-f13fe7147ddf8d527df855b1dfa0db4ae22107bb.tar.gz
dotty-f13fe7147ddf8d527df855b1dfa0db4ae22107bb.tar.bz2
dotty-f13fe7147ddf8d527df855b1dfa0db4ae22107bb.zip
Typer#escapingRefs: remove dead code
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 8189f3c67..af041e785 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -515,16 +515,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
}
def escapingRefs(block: Tree, localSyms: => List[Symbol])(implicit ctx: Context): collection.Set[NamedType] = {
- var hoisted: Set[Symbol] = Set()
lazy val locals = localSyms.toSet
- def leakingTypes(tp: Type): collection.Set[NamedType] =
- tp namedPartsWith (tp => locals.contains(tp.symbol))
- def typeLeaks(tp: Type): Boolean = leakingTypes(tp).nonEmpty
- def classLeaks(sym: ClassSymbol): Boolean =
- (ctx.owner is Method) || // can't hoist classes out of method bodies
- (sym.info.parents exists typeLeaks) ||
- (sym.info.decls.toList exists (t => typeLeaks(t.info)))
- leakingTypes(block.tpe)
+ block.tpe namedPartsWith (tp => locals.contains(tp.symbol))
}
/** Check that expression's type can be expressed without references to locally defined