diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-09 18:14:20 +0200 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-05-20 13:38:49 +0200 |
commit | b2c545173ab4869eb1b193d44f822efb83df104c (patch) | |
tree | 9f081bbaebbe03e5824d8acc2332f48b47483e26 /tests/pending/pos/boundspropagation.scala | |
parent | 27081ae59ba5b00b6ae05bb3cdd9c3ff7db0a28e (diff) | |
download | dotty-b2c545173ab4869eb1b193d44f822efb83df104c.tar.gz dotty-b2c545173ab4869eb1b193d44f822efb83df104c.tar.bz2 dotty-b2c545173ab4869eb1b193d44f822efb83df104c.zip |
Nothing is not a superclass of Null.
Fix so it isn't.
This caused an error in ErrorReporting because we do not propagate
bounds into a type like ValOrDefDef[_]. Error in `ErrorReporting` is now fixed but the problem is
reflected in test case `boundspropagation`.
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 + } +} |