diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-07 19:09:52 +0200 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-05-20 13:38:49 +0200 |
commit | 27081ae59ba5b00b6ae05bb3cdd9c3ff7db0a28e (patch) | |
tree | ab350b5ef2d7b9adc29fe715be2efb4681970127 /tests/pos/t2399.scala | |
parent | fb3dba1bac13a755d2304928cbd49e7dde6f1bf9 (diff) | |
download | dotty-27081ae59ba5b00b6ae05bb3cdd9c3ff7db0a28e.tar.gz dotty-27081ae59ba5b00b6ae05bb3cdd9c3ff7db0a28e.tar.bz2 dotty-27081ae59ba5b00b6ae05bb3cdd9c3ff7db0a28e.zip |
Tests pos/23xx to 24xx.
Diffstat (limited to 'tests/pos/t2399.scala')
-rw-r--r-- | tests/pos/t2399.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/t2399.scala b/tests/pos/t2399.scala new file mode 100644 index 000000000..a99998a0a --- /dev/null +++ b/tests/pos/t2399.scala @@ -0,0 +1,14 @@ +trait That1[A] +trait That2[A, R <: That2[A, R]] + +trait T[A, This >: Null <: That1[A] with T[A, This]] extends That2[A, This] { + self: This => + + private var next: This = _ + def isEmpty = next eq null + + def length: Int = { + def loop(x: This, cnt: Int): Int = if (x.isEmpty) cnt else loop(x.next, cnt + 1) + loop(self, 0) + } +} |