summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-10-30 14:29:14 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-11-01 18:50:43 -0700
commitd0c4be6861109683d80513eda74e5c6ca88f1441 (patch)
treef0604d9f71cd0807e6a5a6351535a78ac18ddefc /src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
parenta70c8219220b637072b52fc834439d90f0cf5b38 (diff)
downloadscala-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.scala9
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()
}
}
}
}
}
-