@@ -24,13 +24,13 @@ class B3(msg0: String) extends A("msg") // warn /Dotty: unused explicit paramete
2424trait Bing
2525
2626trait Accessors {
27- private var v1 : Int = 0 // warn warn
28- private var v2 : Int = 0 // warn warn , never set
29- private var v3 : Int = 0
27+ private var v1 : Int = 0 // warn
28+ private var v2 : Int = 0 // warn, never set
29+ private var v3 : Int = 0 // warn, never got
3030 private var v4 : Int = 0 // no warn
3131
32- private [this ] var v5 = 0 // warn warn , never set
33- private [this ] var v6 = 0
32+ private [this ] var v5 = 0 // warn, never set
33+ private [this ] var v6 = 0 // warn, never got
3434 private [this ] var v7 = 0 // no warn
3535
3636 def bippy (): Int = {
@@ -43,13 +43,13 @@ trait Accessors {
4343}
4444
4545class StableAccessors {
46- private var s1 : Int = 0 // warn warn
47- private var s2 : Int = 0 // warn warn , never set
48- private var s3 : Int = 0
46+ private var s1 : Int = 0 // warn
47+ private var s2 : Int = 0 // warn, never set
48+ private var s3 : Int = 0 // warn, never got
4949 private var s4 : Int = 0 // no warn
5050
51- private [this ] var s5 = 0 // warn warn , never set
52- private [this ] var s6 = 0 // no warn, limitation /Dotty: Why limitation ?
51+ private [this ] var s5 = 0 // warn, never set
52+ private [this ] var s6 = 0 // warn, never got
5353 private [this ] var s7 = 0 // no warn
5454
5555 def bippy (): Int = {
@@ -62,7 +62,7 @@ class StableAccessors {
6262}
6363
6464trait DefaultArgs {
65- private def bippy (x1 : Int , x2 : Int = 10 , x3 : Int = 15 ): Int = x1 + x2 + x3 // no more warn warn since #17061
65+ private def bippy (x1 : Int , x2 : Int = 10 , x3 : Int = 15 ): Int = x1 + x2 + x3 // warn // warn
6666
6767 def boppy () = bippy(5 , 100 , 200 )
6868}
@@ -124,9 +124,9 @@ trait Underwarn {
124124}
125125
126126class OtherNames {
127- private def x_= (i : Int ): Unit = () // no more warn since #17061
128- private def x : Int = 42 // warn Dotty triggers unused private member : To investigate
129- private def y_= (i : Int ): Unit = () // // no more warn since #17061
127+ private def x_= (i : Int ): Unit = () // warn
128+ private def x : Int = 42 // warn
129+ private def y_= (i : Int ): Unit = () // warn
130130 private def y : Int = 42
131131
132132 def f = y
@@ -145,7 +145,7 @@ trait Forever {
145145 val t = Option ((17 , 42 ))
146146 for {
147147 ns <- t
148- (i, j) = ns // no warn
148+ (i, j) = ns // warn // warn -Wunused:patvars is in -Wunused:all
149149 } yield 42 // val emitted only if needed, hence nothing unused
150150 }
151151}
@@ -158,22 +158,22 @@ trait CaseyKasem {
158158 def f = 42 match {
159159 case x if x < 25 => " no warn"
160160 case y if toString.nonEmpty => " no warn" + y
161- case z => " warn"
161+ case z => " warn" // warn patvar
162162 }
163163}
164164trait CaseyAtTheBat {
165165 def f = Option (42 ) match {
166166 case Some (x) if x < 25 => " no warn"
167- case Some (y @ _) if toString.nonEmpty => " no warn"
168- case Some (z) => " warn"
167+ case Some (y @ _) if toString.nonEmpty => " no warn" // warn todo whether to use name @ _ to suppress
168+ case Some (z) => " warn" // warn patvar
169169 case None => " no warn"
170170 }
171171}
172172
173173class `not even using companion privates`
174174
175175object `not even using companion privates` {
176- private implicit class `for your eyes only` (i : Int ) { // no more warn since #17061
176+ private implicit class `for your eyes only` (i : Int ) { // warn
177177 def f = i
178178 }
179179}
0 commit comments