aboutsummaryrefslogblamecommitdiff
path: root/tests/run/t6337a.scala
blob: 0a78cd0b8ce3d20f055c12c08584147da12c0649 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
             
                                         













                                                 
object Test {
  def main(args: Array[String]): Unit = {
    val x = X(XX(3))
    assert(x.q.x.x + 9 == 13)
  }
}
trait Q extends Any {
   def x: Int
   def inc: XX
}
case class X(val x: Q) extends AnyVal {
   def q = X(x.inc)
}
case class XX(val x: Int) extends AnyVal with Q {
   def inc = XX(x + 1)
}