aboutsummaryrefslogtreecommitdiff
path: root/tests/run/i1263.scala
blob: e97606ef6bc9b64ff32331ae7c4a96d2a7896559 (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
object Test {
  trait Foo(val s: String)

  val foo1 = new Foo("bar") {}
  def main(args: Array[String]): Unit = {
    assert(foo1.s == "bar")
  }
}
object Test1 {
  trait Foo(private val s0: String) {
    def s = s0
  }

  val foo1 = new Foo("bar") {}
  def main(args: Array[String]): Unit = {
    assert(foo1.s == "bar")
  }
}
object Test2 {
  trait Foo(protected val s: String)

  val foo1 = new Foo("bar") {}
}
object Test3 {
  trait Foo(final val s: String)

  val foo1 = new Foo("bar") {}
  def main(args: Array[String]): Unit = {
    assert(foo1.s == "bar")
  }
}