blob: 3a1532b823b975d1c81e327f3bf7ac370fdf83ce (
plain) (
blame)
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
37
38
|
Type in expressions to have them evaluated.
Type :help for more information.
scala>
scala> import annotation.static
import annotation.static
scala> @static var x1 = 42
x1: Int = 42
scala> @static val x2 = 43
x2: Int = 43
scala> @static def x3 = 44
<console>:8: error: The @static annotation is not allowed on method definitions.
@static def x3 = 44
^
scala> x1
res0: Int = 42
scala> x2
res1: Int = 43
scala> x3
<console>:9: error: not found: value x3
x3
^
scala> class Test {
@static def x = 42
}
<console>:9: error: The @static annotation is not allowed on method definitions.
@static def x = 42
^
scala>
|