@@ -12,7 +12,7 @@ import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory}
1212import dotty .tools .backend .jvm .BackendUtils .classfileVersionMap
1313import Setting .ChoiceWithHelp
1414
15- import scala .util .chaining .*
15+ import dotty . tools . dotc .util .chaining .*
1616
1717import java .util .zip .Deflater
1818
@@ -179,28 +179,20 @@ private sealed trait WarningSettings:
179179 choices = List (
180180 ChoiceWithHelp (" nowarn" , " " ),
181181 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." ),
186183 ChoiceWithHelp (" privates" , " Warn if a private member is unused" ),
187184 ChoiceWithHelp (" locals" , " Warn if a local definition is unused" ),
188185 ChoiceWithHelp (" explicits" , " Warn if an explicit parameter is unused" ),
189186 ChoiceWithHelp (" implicits" , " Warn if an implicit parameter is unused" ),
190187 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
191190 ChoiceWithHelp (" linted" , " Enable -Wunused:imports,privates,locals,implicits" ),
192191 ChoiceWithHelp (
193192 name = " strict-no-implicit-warn" ,
194193 description = " Same as -Wunused:import, only for imports of explicit named members.\n " +
195194 " NOTE : This overrides -Wunused:imports and NOT set by -Wunused:all"
196195 ),
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- )
204196 ),
205197 default = Nil
206198 )
@@ -212,7 +204,6 @@ private sealed trait WarningSettings:
212204 // Is any choice set for -Wunused?
213205 def any (using Context ): Boolean = Wall .value || Wunused .value.nonEmpty
214206
215- // overrided by strict-no-implicit-warn
216207 def imports (using Context ) =
217208 (allOr(" imports" ) || allOr(" linted" )) && ! (strictNoImplicitWarn)
218209 def locals (using Context ) =
@@ -226,9 +217,8 @@ private sealed trait WarningSettings:
226217 def params (using Context ) = allOr(" params" )
227218 def privates (using Context ) =
228219 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" )
232222 def linted (using Context ) =
233223 allOr(" linted" )
234224 def strictNoImplicitWarn (using Context ) =
0 commit comments