summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-07-09 18:14:06 +0200
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-07-17 15:49:20 +0200
commitdda3f241e7c47d13710be6a7e1ea9d5ef69709b2 (patch)
tree04ae4224507adb9d6aa77629a3d419c73191a586 /src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
parentb8503f6cf937b739341a6a387800c4542e81ae77 (diff)
downloadscala-dda3f241e7c47d13710be6a7e1ea9d5ef69709b2.tar.gz
scala-dda3f241e7c47d13710be6a7e1ea9d5ef69709b2.tar.bz2
scala-dda3f241e7c47d13710be6a7e1ea9d5ef69709b2.zip
Rely less on intricacies of `contextMode`-based reporting.
- when warning must not be suppressed, use `reporter.warning` - don't (implicitly) rely on `reporter.warning` being silent after typer --> don't do pure expression check after typer
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
index 7440f69e93..fbea69db5a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
@@ -572,11 +572,11 @@ trait TypeDiagnostics {
} else f
}
def apply(tree: Tree): Tree = {
- // Error suppression will squash some of these warnings unless we circumvent it.
+ // Error suppression (in context.warning) would squash some of these warnings.
// It is presumed if you are using a -Y option you would really like to hear
- // the warnings you've requested.
+ // the warnings you've requested; thus, use reporter.warning.
if (settings.warnDeadCode && context.unit.exists && treeOK(tree) && exprOK)
- context.warning(tree.pos, "dead code following this construct", force = true)
+ reporter.warning(tree.pos, "dead code following this construct")
tree
}