aboutsummaryrefslogtreecommitdiff
path: root/tests/pos-scala2/t2994.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-01-31 14:03:26 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-09 09:43:05 +0100
commit9a6f82b2ecfd7462d0a1f4e0464878fd58231277 (patch)
tree8e9e46b08d7fdf45f4b1fd06b30d7e35c43f05b1 /tests/pos-scala2/t2994.scala
parent44c14b3fb6e5eb6f2b9734f092eef1d85f6b4d18 (diff)
downloaddotty-9a6f82b2ecfd7462d0a1f4e0464878fd58231277.tar.gz
dotty-9a6f82b2ecfd7462d0a1f4e0464878fd58231277.tar.bz2
dotty-9a6f82b2ecfd7462d0a1f4e0464878fd58231277.zip
Reorganize tests to account for new typing of projection
Tests with failed projections are moved to pos-scala2, which was renamed from pos-special. Files in pos-scala2 are compiled with -language:Scala2 option.
Diffstat (limited to 'tests/pos-scala2/t2994.scala')
-rw-r--r--tests/pos-scala2/t2994.scala35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/pos-scala2/t2994.scala b/tests/pos-scala2/t2994.scala
new file mode 100644
index 000000000..c7421c42a
--- /dev/null
+++ b/tests/pos-scala2/t2994.scala
@@ -0,0 +1,35 @@
+object Naturals {
+ trait NAT {
+ type a[s[_ <: NAT] <: NAT, z <: NAT] <: NAT
+ type v = a[SUCC, ZERO]
+ }
+ final class ZERO extends NAT {
+ type a[s[_ <: NAT] <: NAT, z <: NAT] = z
+ }
+ final class SUCC[n <: NAT] extends NAT {
+ type a[s[_ <: NAT] <: NAT, z <: NAT] = s[n#a[s, z]]
+ }
+ type _0 = ZERO
+ type _1 = SUCC[_0]
+ type _2 = SUCC[_1]
+ type _3 = SUCC[_2]
+ type _4 = SUCC[_3]
+ type _5 = SUCC[_4]
+ type _6 = SUCC[_5]
+
+
+ // crashes scala-2.8.0 beta1
+ trait MUL[n <: NAT, m <: NAT] extends NAT {
+ trait curry[n[_, _], s[_]] { type f[z <: NAT] = n[s, z] }
+ type a[s[_ <: NAT] <: NAT, z <: NAT] = n#a[curry[m#a, s]#f, z]
+ }
+
+}
+
+object Test {
+ trait Bar[X[_]]
+ trait Baz[S[_] <: Bar[S]] {
+ type Apply[T]
+ }
+ trait Foo[V[_] <: Bar[V]] extends Bar[Baz[V]#Apply]
+}