summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-10-02 21:44:08 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-10-02 21:44:08 +1000
commit192d65f718ab042cb57090d580c83e15a0509964 (patch)
treec460241bb554d8ec04aabcbb4714cfcda0a260a3 /test
parent955256f9b27ea6ec28ced548b4fe8ae4f98dd65d (diff)
parent84d46719a9ab3caa7ff46af4630d75f8c407c3d2 (diff)
downloadscala-192d65f718ab042cb57090d580c83e15a0509964.tar.gz
scala-192d65f718ab042cb57090d580c83e15a0509964.tar.bz2
scala-192d65f718ab042cb57090d580c83e15a0509964.zip
Merge pull request #4021 from retronym/ticket/8869
SI-8869 Prevent ill-kindedness in type lambdas
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t8869.check7
-rw-r--r--test/files/neg/t8869.scala10
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t8869.check b/test/files/neg/t8869.check
new file mode 100644
index 0000000000..40b8570f9f
--- /dev/null
+++ b/test/files/neg/t8869.check
@@ -0,0 +1,7 @@
+t8869.scala:5: error: class Option takes type parameters
+ def value: TC[({type l1[x] = Option})#l1] = ??? // error not reported!
+ ^
+t8869.scala:7: error: class Option takes type parameters
+ type l2[x] = Option // error correctly reported
+ ^
+two errors found
diff --git a/test/files/neg/t8869.scala b/test/files/neg/t8869.scala
new file mode 100644
index 0000000000..0c7f0c9451
--- /dev/null
+++ b/test/files/neg/t8869.scala
@@ -0,0 +1,10 @@
+class TC[T[_]] {
+ def identity[A](a: T[A]): T[A] = a
+}
+object Test {
+ def value: TC[({type l1[x] = Option})#l1] = ??? // error not reported!
+
+ type l2[x] = Option // error correctly reported
+ def value1: TC[l2] = ???
+}
+