aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/boundspropagation.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/boundspropagation.scala')
-rw-r--r--tests/pos/boundspropagation.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/pos/boundspropagation.scala b/tests/pos/boundspropagation.scala
new file mode 100644
index 000000000..164f1ae1a
--- /dev/null
+++ b/tests/pos/boundspropagation.scala
@@ -0,0 +1,18 @@
+// test contributed by @retronym
+object test1 {
+ class Base {
+ type N
+
+ class Tree[-T >: N]
+
+ def f(x: Any): Tree[N] = x match {
+ case y: Tree[_] => y
+ }
+ }
+ class Derived extends Base {
+ def g(x: Any): Tree[N] = x match {
+ case y: Tree[_] => y // now succeeds in dotc
+ }
+ }
+}
+