diff options
author | Paul Phillips <paulp@improving.org> | 2013-05-30 16:55:39 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-05-31 04:21:43 -0700 |
commit | 14534c693d2eb6acafaf8244c14b5643388fbd67 (patch) | |
tree | 20b5bb989a4629bc794e1c9fae591dd5d98ede10 /test/files/neg/t2994a.scala | |
parent | cfef577e478161bd4d1e24626e0909c80c04e1b9 (diff) | |
download | scala-14534c693d2eb6acafaf8244c14b5643388fbd67.tar.gz scala-14534c693d2eb6acafaf8244c14b5643388fbd67.tar.bz2 scala-14534c693d2eb6acafaf8244c14b5643388fbd67.zip |
SI-7517 type constructors too eagerly normalized.
I think 403eadd0f1 was largely a symptomatic remedy
(not that we shouldn't harden against such outcomes)
and that this commit gets closer to the root causes.
The unanticipated change to test/files/run/t6113.check
is like a cry of support from the jury box.
-Foo[[X](Int, X)]
+Foo[AnyRef{type l[X] = (Int, X)}#l]
We should continue to look at calls to normalize with
grave suspicion.
Diffstat (limited to 'test/files/neg/t2994a.scala')
-rw-r--r-- | test/files/neg/t2994a.scala | 27 |
1 files changed, 27 insertions, 0 deletions
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 |