From 1b1461fed759c8f937c01fe2e7d3922ab67df700 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 17 Feb 2014 17:31:28 +0100 Subject: SI-7707 SI-7712 Exclude unused warnings from -Xlint Experience building open source projects like Specs that use `-Xlint` suggests that this warning is too noisy to lump in with the others. We are lacking in more fine-grained control of these things, so simply turning of `-Xlint` in favour of its underlying `-Y` options ends up *losing* some other important warnings that are predicated directly on `-Xlint`. Furthermore, bug reports against M8, SI-7707 SI-7712, show that unused private/local warnings, while far less noisy, are still in need of polish. This commit moves these warnings to a pair of new -Y options, neither of which is part of `-Xlint`.. Let's ask people to opt in for 2.11, and as it stabilizes, we can consider adding it to Xlint (or the desirable evolution of that) in the next release. --- test/files/neg/warn-unused-imports.check | 13 +------------ test/files/neg/warn-unused-imports.flags | 2 +- test/files/neg/warn-unused-privates.flags | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/files/neg/warn-unused-imports.check b/test/files/neg/warn-unused-imports.check index 1b938f4fd7..36c6dd03c3 100644 --- a/test/files/neg/warn-unused-imports.check +++ b/test/files/neg/warn-unused-imports.check @@ -1,11 +1,3 @@ -warn-unused-imports.scala:7: warning: it is not recommended to define classes/objects inside of package objects. -If possible, define class A in package p1 instead. - class A - ^ -warn-unused-imports.scala:13: warning: it is not recommended to define classes/objects inside of package objects. -If possible, define class A in package p2 instead. - class A - ^ warn-unused-imports.scala:57: warning: Unused import import p1.A // warn ^ @@ -36,9 +28,6 @@ warn-unused-imports.scala:98: warning: Unused import warn-unused-imports.scala:118: warning: Unused import import p1.A // warn ^ -warn-unused-imports.scala:99: warning: local trait Warn is never used - trait Warn { // warn about unused local trait for good measure - ^ error: No warnings can be incurred under -Xfatal-warnings. -13 warnings found +10 warnings found one error found diff --git a/test/files/neg/warn-unused-imports.flags b/test/files/neg/warn-unused-imports.flags index 954eaba352..24db705df1 100644 --- a/test/files/neg/warn-unused-imports.flags +++ b/test/files/neg/warn-unused-imports.flags @@ -1 +1 @@ --Xfatal-warnings -Xlint +-Xfatal-warnings -Ywarn-unused-import diff --git a/test/files/neg/warn-unused-privates.flags b/test/files/neg/warn-unused-privates.flags index 7949c2afa2..25474aefb3 100644 --- a/test/files/neg/warn-unused-privates.flags +++ b/test/files/neg/warn-unused-privates.flags @@ -1 +1 @@ --Xlint -Xfatal-warnings +-Ywarn-unused -Xfatal-warnings -- cgit v1.2.3