-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
nowarn.scala
36 lines (34 loc) · 1.11 KB
/
nowarn.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.annotation
/** An annotation for local warning suppression.
*
* The optional `value` parameter allows selectively silencing messages, see `scalac -Wconf:help`
* for help. Examples:
*
* {{{
* def f = {
* 1: @nowarn // don't warn "a pure expression does nothing in statement position"
* 2
* }
*
* @nowarn def f = { 1; deprecated() } // don't warn
*
* @nowarn("msg=pure expression does nothing")
* def f = { 1; deprecated() } // show deprecation warning
* }}}
*
* To ensure that a `@nowarn` annotation actually suppresses a warning, enable `-Xlint:unused` or `-Wunused:nowarn`.
* The unused annotation warning is emitted in category `unused-nowarn` and can be selectively managed
* using `-Wconf:cat=unused-nowarn:s`.
*/
class nowarn(value: String = "") extends ConstantAnnotation