aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/scala2traits/dotty-subclass.scala
blob: 62720b993a6c692cac2012fdc0a494caf58cc95a (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
// This is supposed to be compiled by Dotty
class Sub extends T

trait DT {

  @volatile lazy val dx = 2

}

class A extends S2T with S2Tprivate with DT {
  val a: Int = 3
  var b = 2
}

object Main {
  def main(args: Array[String]): Unit = {
    val sub = new Sub
    println(sub.d)
    println(sub.v)
    println(sub.O)
    println(sub.w)

    val a = new A
    a.x += a.y
    println(a.x)
    println(a.f(a.a + a.b))

    a.xx += a.yy
    println(a.x)
    println(a.ff(a.xx))
  }
}