@@ -12,7 +12,7 @@ import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory}
12
12
import dotty .tools .backend .jvm .BackendUtils .classfileVersionMap
13
13
import Setting .ChoiceWithHelp
14
14
15
- import scala .util .chaining .*
15
+ import dotty . tools . dotc .util .chaining .*
16
16
17
17
import java .util .zip .Deflater
18
18
@@ -179,28 +179,20 @@ private sealed trait WarningSettings:
179
179
choices = List (
180
180
ChoiceWithHelp (" nowarn" , " " ),
181
181
ChoiceWithHelp (" all" , " " ),
182
- ChoiceWithHelp (
183
- name = " imports" ,
184
- description = " Warn if an import selector is not referenced.\n " +
185
- " NOTE : overrided by -Wunused:strict-no-implicit-warn" ),
182
+ ChoiceWithHelp (" imports" , " Warn if an import selector is not referenced." ),
186
183
ChoiceWithHelp (" privates" , " Warn if a private member is unused" ),
187
184
ChoiceWithHelp (" locals" , " Warn if a local definition is unused" ),
188
185
ChoiceWithHelp (" explicits" , " Warn if an explicit parameter is unused" ),
189
186
ChoiceWithHelp (" implicits" , " Warn if an implicit parameter is unused" ),
190
187
ChoiceWithHelp (" params" , " Enable -Wunused:explicits,implicits" ),
188
+ ChoiceWithHelp (" patvars" ," Warn if a variable bound in a pattern is unused" ),
189
+ // ChoiceWithHelp("inlined", "Apply -Wunused to inlined expansions"), // TODO
191
190
ChoiceWithHelp (" linted" , " Enable -Wunused:imports,privates,locals,implicits" ),
192
191
ChoiceWithHelp (
193
192
name = " strict-no-implicit-warn" ,
194
193
description = " Same as -Wunused:import, only for imports of explicit named members.\n " +
195
194
" NOTE : This overrides -Wunused:imports and NOT set by -Wunused:all"
196
195
),
197
- // ChoiceWithHelp("patvars","Warn if a variable bound in a pattern is unused"),
198
- ChoiceWithHelp (
199
- name = " unsafe-warn-patvars" ,
200
- description = " (UNSAFE) Warn if a variable bound in a pattern is unused.\n " +
201
- " This warning can generate false positive, as warning cannot be\n " +
202
- " suppressed yet."
203
- )
204
196
),
205
197
default = Nil
206
198
)
@@ -212,7 +204,6 @@ private sealed trait WarningSettings:
212
204
// Is any choice set for -Wunused?
213
205
def any (using Context ): Boolean = Wall .value || Wunused .value.nonEmpty
214
206
215
- // overrided by strict-no-implicit-warn
216
207
def imports (using Context ) =
217
208
(allOr(" imports" ) || allOr(" linted" )) && ! (strictNoImplicitWarn)
218
209
def locals (using Context ) =
@@ -226,9 +217,8 @@ private sealed trait WarningSettings:
226
217
def params (using Context ) = allOr(" params" )
227
218
def privates (using Context ) =
228
219
allOr(" privates" ) || allOr(" linted" )
229
- def patvars (using Context ) =
230
- isChoiceSet(" unsafe-warn-patvars" ) // not with "all"
231
- // allOr("patvars") // todo : rename once fixed
220
+ def patvars (using Context ) = allOr(" patvars" )
221
+ def inlined (using Context ) = isChoiceSet(" inlined" )
232
222
def linted (using Context ) =
233
223
allOr(" linted" )
234
224
def strictNoImplicitWarn (using Context ) =
0 commit comments