summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Reporting.scala4
-rw-r--r--test/files/pos/t8410.flags1
-rw-r--r--test/files/pos/t8410.scala15
3 files changed, 18 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/Reporting.scala b/src/compiler/scala/tools/nsc/Reporting.scala
index b164f395fe..c9782de7c8 100644
--- a/src/compiler/scala/tools/nsc/Reporting.scala
+++ b/src/compiler/scala/tools/nsc/Reporting.scala
@@ -33,7 +33,7 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
if (option) reporter.warning(pos, msg)
else if (!(warnings contains pos)) warnings += ((pos, msg))
def summarize() =
- if (warnings.nonEmpty && (option.isDefault || settings.fatalWarnings)) {
+ if (warnings.nonEmpty && (option.isDefault || option)) {
val numWarnings = warnings.size
val warningVerb = if (numWarnings == 1) "was" else "were"
val warningCount = countElementsAsString(numWarnings, s"$what warning")
@@ -105,4 +105,4 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
reporter.error(NoPosition, "No warnings can be incurred under -Xfatal-warnings.")
}
}
-} \ No newline at end of file
+}
diff --git a/test/files/pos/t8410.flags b/test/files/pos/t8410.flags
new file mode 100644
index 0000000000..dcd5943c2f
--- /dev/null
+++ b/test/files/pos/t8410.flags
@@ -0,0 +1 @@
+-optimise -Xfatal-warnings -deprecation:false -Yinline-warnings:false
diff --git a/test/files/pos/t8410.scala b/test/files/pos/t8410.scala
new file mode 100644
index 0000000000..4d862311fa
--- /dev/null
+++ b/test/files/pos/t8410.scala
@@ -0,0 +1,15 @@
+
+object Test extends App {
+ @deprecated("","") def f = 42
+ @deprecated("","") def z = f
+ def g = { @deprecated("","") def _f = f ; _f } // warns in 2.11.0-M8
+ def x = { @deprecated("","") class X { def x = f } ; new X().x } // warns in 2.11.0-M8
+ Console println g
+ Console println f // warns
+
+ @deprecated("","") trait T
+ object T extends T { def t = f }
+ Console println T.t
+
+ def k = List(0).dropWhile(_ < 1) // inlining warns doubly
+}