aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/boundspropagation.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/neg/boundspropagation.scala')
-rw-r--r--tests/neg/boundspropagation.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/neg/boundspropagation.scala b/tests/neg/boundspropagation.scala
index 560d5416c..bc39e042e 100644
--- a/tests/neg/boundspropagation.scala
+++ b/tests/neg/boundspropagation.scala
@@ -24,3 +24,17 @@ object test3 {
case y: Tree[_] => y
}
}
+
+// Example contributed by Jason. I believe this should not typecheck,
+// even though scalac does typecheck it.
+object test4 {
+ class Base {
+ type N
+
+ class Tree[-S, -T >: Option[S]]
+
+ def g(x: Any): Tree[_, _ <: Option[N]] = x match {
+ case y: Tree[_, _] => y
+ }
+ }
+}