diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-30 14:29:14 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-11-01 18:50:43 -0700 |
commit | d0c4be6861109683d80513eda74e5c6ca88f1441 (patch) | |
tree | f0604d9f71cd0807e6a5a6351535a78ac18ddefc /src/compiler/scala/tools/nsc/typechecker/Analyzer.scala | |
parent | a70c8219220b637072b52fc834439d90f0cf5b38 (diff) | |
download | scala-d0c4be6861109683d80513eda74e5c6ca88f1441.tar.gz scala-d0c4be6861109683d80513eda74e5c6ca88f1441.tar.bz2 scala-d0c4be6861109683d80513eda74e5c6ca88f1441.zip |
Warn about unused private members.
Warnings enabled via -Xlint. It's one of the most requested
features. And it is hard to argue we don't need it: see the
99 methods removed in the next commit.
This should close SI-440.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Analyzer.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Analyzer.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala index 3526d932d3..9a6b5c45c4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala @@ -95,14 +95,17 @@ trait Analyzer extends AnyRef } def apply(unit: CompilationUnit) { try { - unit.body = newTyper(rootContext(unit)).typed(unit.body) + val typer = newTyper(rootContext(unit)) + unit.body = typer.typed(unit.body) if (global.settings.Yrangepos.value && !global.reporter.hasErrors) global.validatePositions(unit.body) for (workItem <- unit.toCheck) workItem() - } finally { + if (settings.lint.value) + typer checkUnused unit + } + finally { unit.toCheck.clear() } } } } } - |