From d0c4be6861109683d80513eda74e5c6ca88f1441 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 30 Oct 2012 14:29:14 -0700 Subject: 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. --- test/files/neg/warn-unused-privates.check | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/files/neg/warn-unused-privates.check (limited to 'test/files/neg/warn-unused-privates.check') diff --git a/test/files/neg/warn-unused-privates.check b/test/files/neg/warn-unused-privates.check new file mode 100644 index 0000000000..c37e01106c --- /dev/null +++ b/test/files/neg/warn-unused-privates.check @@ -0,0 +1,30 @@ +warn-unused-privates.scala:2: warning: private constructor in class Bippy is never used + private def this(c: Int) = this(c, c) // warn + ^ +warn-unused-privates.scala:4: warning: private method in class Bippy is never used + private def boop(x: Int) = x+a+b // warn + ^ +warn-unused-privates.scala:6: warning: private getter in class Bippy is never used + final private val MILLIS2: Int = 1000 // warn + ^ +warn-unused-privates.scala:13: warning: private getter in object Bippy is never used + private val HEY_INSTANCE: Int = 1000 // warn + ^ +warn-unused-privates.scala:41: warning: private getter in trait Accessors is never used + private var v1: Int = 0 // warn + ^ +warn-unused-privates.scala:42: warning: private setter in trait Accessors is never used + private var v2: Int = 0 // warn, never set + ^ +warn-unused-privates.scala:43: warning: private getter in trait Accessors is never used + private var v3: Int = 0 // warn, never got + ^ +warn-unused-privates.scala:55: warning: private default argument in trait DefaultArgs is never used + private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3 + ^ +warn-unused-privates.scala:55: warning: private default argument in trait DefaultArgs is never used + private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3 + ^ +error: No warnings can be incurred under -Xfatal-warnings. +9 warnings found +one error found -- cgit v1.2.3