Skip to content

Commit 0926d73

Browse files
authored
Merge pull request scala/scala#9248 from dwijnand/2.12/conf-warnings
2 parents 5105d8f + b1ea828 commit 0926d73

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala.annotation
14+
15+
/** An annotation for local warning suppression.
16+
*
17+
* The optional `value` parameter allows selectively silencing messages, see `scalac -Wconf:help`
18+
* for help. Examples:
19+
*
20+
* {{{
21+
* def f = {
22+
* 1: @nowarn // don't warn "a pure expression does nothing in statement position"
23+
* 2
24+
* }
25+
*
26+
* @nowarn def f = { 1; deprecated() } // don't warn
27+
*
28+
* @nowarn("msg=pure expression does nothing")
29+
* def f = { 1; deprecated() } // show deprecation warning
30+
* }}}
31+
*
32+
* To ensure that a `@nowarn` annotation actually suppresses a warning, enable `-Xlint:nowarn`.
33+
*/
34+
class nowarn(value: String = "") extends ClassfileAnnotation

library/src/scala/annotation/tailrec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ package scala.annotation
2020
*
2121
* @since 2.8
2222
*/
23-
final class tailrec extends scala.annotation.StaticAnnotation
23+
final class tailrec extends StaticAnnotation

library/src/scala/annotation/unchecked/uncheckedStable.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
package scala.annotation.unchecked
1414

15+
import scala.annotation.meta.{field, getter}
16+
1517
/** An annotation for values that are assumed to be stable even though their
1618
* types are volatile.
1719
*
1820
* @since 2.7
1921
*/
22+
@getter @field
2023
final class uncheckedStable extends scala.annotation.StaticAnnotation {}

0 commit comments

Comments
 (0)