summaryrefslogtreecommitdiff
path: root/test/files/neg/static-annot.scala
blob: c0b5ed30d848971e83adab1dfe16c6683cace16d (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import annotation.static



class StaticInClass {
  @static val bar = 1
}


class NestedObjectInClass {
  object Nested {
    @static val blah = 2
  }
}


object NestedObjectInObject {
  object Nested {
    @static val succeed = 3
  }
}


object Conflicting {
  @static val bar = 1
}


class Conflicting {
  val bar = 45
}


object PrivateProtectedLazy {
  @static private val bar = 1
  @static private val baz = 2
  @static lazy val bam = 3
}


class PrivateProtectedLazy {
  println(PrivateProtectedLazy.bar)
  println(PrivateProtectedLazy.baz)
  println(PrivateProtectedLazy.bam)
}


class StaticDef {
  // this should not crash the compiler
  @static def x = 42
}