summaryrefslogtreecommitdiff
path: root/13-user-defined-annotations.md
diff options
context:
space:
mode:
Diffstat (limited to '13-user-defined-annotations.md')
-rw-r--r--13-user-defined-annotations.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/13-user-defined-annotations.md b/13-user-defined-annotations.md
index 4397ebdef2..1aa5e7e613 100644
--- a/13-user-defined-annotations.md
+++ b/13-user-defined-annotations.md
@@ -1,6 +1,6 @@
# User-Defined Annotations
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Annotation ::= ‘@’ SimpleType {ArgumentExprs}
ConstrAnnotation ::= ‘@’ SimpleType ArgumentExprs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -20,7 +20,7 @@ does not matter.
Examples:
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@serializable class C { ... } // A class annotation.
@transient @volatile var m: Int // A variable annotation
String @local // A type annotation
@@ -55,7 +55,7 @@ Java platform, the following annotations have a standard meaning.
This is equivalent to a the following field
definition in Java:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
private final static SerialVersionUID = <longlit>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -95,7 +95,7 @@ Java platform, the following annotations have a standard meaning.
matches which would otherwise be emitted. For instance, no warnings
would be produced for the method definition below.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def f(x: Option[Int]) = (x: @unchecked) match {
case Some(y) => y
}
@@ -110,7 +110,7 @@ Java platform, the following annotations have a standard meaning.
value to appear in a path, even if its type is [volatile](#volatile-types).
For instance, the following member definitions are legal:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type A { type T }
type B
@uncheckedStable val x: A with B // volatile type
@@ -135,7 +135,7 @@ Java platform, the following annotations have a standard meaning.
For instance, the following code would generate specialized traits for
`Unit`, `Int` and `Double`
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
trait Function0[@specialized(Unit, Int, Double) T] {
def apply: T
}