diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-24 23:05:42 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-24 23:05:42 +0100 |
commit | f86c36f8e05bccc1bb7df07f50b565514fd7f100 (patch) | |
tree | 51e2a41281b26d9e763f71666df5446fac0e414f /test/files | |
parent | 396742c899600cda14c24442cf063c78d1fc6ae8 (diff) | |
download | scala-f86c36f8e05bccc1bb7df07f50b565514fd7f100.tar.gz scala-f86c36f8e05bccc1bb7df07f50b565514fd7f100.tar.bz2 scala-f86c36f8e05bccc1bb7df07f50b565514fd7f100.zip |
SI-2066 -Xsource:2.10: lenient treatment of variance in <:<, =:=
The soundness hole was exploited in Scalaz. They have fixed their
codebase correctly for Scalac 7.1.x, but have less freedom to
break source compatiblity in 7.0.x.
After this commit, they could choose to compile that branch with
-Xsource:2.10
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t2066-2.10-compat.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t2066-2.10-compat.scala | 71 |
2 files changed, 72 insertions, 0 deletions
diff --git a/test/files/pos/t2066-2.10-compat.flags b/test/files/pos/t2066-2.10-compat.flags new file mode 100644 index 0000000000..94c8056747 --- /dev/null +++ b/test/files/pos/t2066-2.10-compat.flags @@ -0,0 +1 @@ +-Xsource:2.10 diff --git a/test/files/pos/t2066-2.10-compat.scala b/test/files/pos/t2066-2.10-compat.scala new file mode 100644 index 0000000000..fb8103e4ad --- /dev/null +++ b/test/files/pos/t2066-2.10-compat.scala @@ -0,0 +1,71 @@ +import language._ +trait A1 { + def f[T[_]] = () +} + +trait B1 extends A1 { + override def f[T[+_]] = () +} + +trait C1 extends A1 { + override def f[T[-_]] = () +} + + +trait A2 { + def f[T[+_]] = () +} + +trait B2 extends A2 { + override def f[T[_]] = () // okay +} + +trait C2 extends A2 { + override def f[T[-_]] = () +} + + +trait A3 { + def f[T[-_]] = () +} + +trait B3 extends A3 { + override def f[T[_]] = () // okay +} + +trait C3 extends A3 { + override def f[T[-_]] = () +} + + +trait A4 { + def f[T[X[+_]]] = () +} + +trait B4 extends A4 { + override def f[T[X[_]]] = () +} + +trait A5 { + def f[T[X[-_]]] = () +} + +trait B5 extends A5 { + override def f[T[X[_]]] = () +} + + + +trait A6 { + def f[T[X[_]]] = () +} + +trait B6 extends A6 { + override def f[T[X[+_]]] = () // okay +} +trait C6 extends A6 { + override def f[T[X[_]]] = () // okay +} +trait D6 extends A6 { + override def f[T[X[-_]]] = () +} |