diff options
Diffstat (limited to 'tests/pending/pos/boundspropagation.scala')
-rw-r--r-- | tests/pending/pos/boundspropagation.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pending/pos/boundspropagation.scala b/tests/pending/pos/boundspropagation.scala new file mode 100644 index 000000000..560d5416c --- /dev/null +++ b/tests/pending/pos/boundspropagation.scala @@ -0,0 +1,26 @@ +// scalac fails for test2/3 +// dotc fails for all three +object test1 { + class Tree[-T >: Null] + + + def f(x: Any): Tree[Null] = x match { + case y: Tree[_] => y + } +} +object test2 { + class Tree[T >: Null] + + + def f(x: Any): Tree[Null] = x match { + case y: Tree[_] => y + } +} +object test3 { + class Tree[+T >: Null] + + + def f(x: Any): Tree[Null] = x match { + case y: Tree[_] => y + } +} |