summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-06-03 17:40:15 -0700
committerPaul Phillips <paulp@improving.org>2013-06-03 17:40:15 -0700
commit2d684df991f5c94f1fe792f8f02da2164a24c649 (patch)
tree420d0fdaa0e57be468db6bef2b06e2dd53ea9a32 /test/files/neg
parent69887ddd682057c4787e2e4377830390faf8ecf1 (diff)
parent14534c693d2eb6acafaf8244c14b5643388fbd67 (diff)
downloadscala-2d684df991f5c94f1fe792f8f02da2164a24c649.tar.gz
scala-2d684df991f5c94f1fe792f8f02da2164a24c649.tar.bz2
scala-2d684df991f5c94f1fe792f8f02da2164a24c649.zip
Merge pull request #2615 from paulp/issue/7517
SI-7517 type constructors too eagerly normalized.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t2994a.check7
-rw-r--r--test/files/neg/t2994a.scala27
2 files changed, 34 insertions, 0 deletions
diff --git a/test/files/neg/t2994a.check b/test/files/neg/t2994a.check
new file mode 100644
index 0000000000..24538a50c3
--- /dev/null
+++ b/test/files/neg/t2994a.check
@@ -0,0 +1,7 @@
+t2994a.scala:24: error: kinds of the type arguments (m#a,s) do not conform to the expected kinds of the type parameters (type n,type s) in trait curry.
+m#a's type parameters do not match type n's expected parameters:
+type _'s bounds <: Naturals.NAT are stricter than type _'s declared bounds >: Nothing <: Any, type z's bounds <: Naturals.NAT are stricter than type _'s declared bounds >: Nothing <: Any, s's type parameters do not match type s's expected parameters:
+type _'s bounds <: Naturals.NAT are stricter than type _ (in trait curry)'s declared bounds >: Nothing <: Any
+ type a[s[_ <: NAT] <: NAT, z <: NAT] = n#a[curry[m#a, s]#f, z]
+ ^
+one error found
diff --git a/test/files/neg/t2994a.scala b/test/files/neg/t2994a.scala
new file mode 100644
index 0000000000..f2d57c34ca
--- /dev/null
+++ b/test/files/neg/t2994a.scala
@@ -0,0 +1,27 @@
+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]
+ }
+
+} \ No newline at end of file