Skip to content

Commit

Permalink
Document silent better
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Sep 23, 2019
1 parent 5fed995 commit d984ebf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/compiler/scala/tools/nsc/settings/Warnings.scala
Expand Up @@ -90,6 +90,8 @@ trait Warnings {
|Full list of message categories:
|${WarningCategory.all.keys.groupBy(_.split('-').head).toList.sortBy(_._1).map(_._2.toList.sorted.mkString(", ")).mkString(" - ", "\n - ", "")}
|
|To suppress warnings locally, use the `scala.annotation.silent` annotation.
|
|Note: on the command-line you might need to quote configurations containing `*` or `&`
|to prevent the shell from expanding patterns.""".stripMargin),
prepend = true)
Expand Down
2 changes: 2 additions & 0 deletions src/library/scala/annotation/silent.scala
Expand Up @@ -28,5 +28,7 @@ package scala.annotation
* @silent("msg=pure expression does nothing")
* def f = { 1; deprecated() } // show deprecation warning
* }}}
*
* To ensure that a `@silent` annotation actually suppresses a warning, enable `-Xlint:silent`.
*/
class silent(value: String = "") extends ConstantAnnotation

0 comments on commit d984ebf

Please sign in to comment.