diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-19 15:47:24 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-24 14:57:49 +0100 |
commit | 958e2a0f8b79402b1a430f0fe7802af9de583d71 (patch) | |
tree | 724b82627676b02683c10b100a6ac5c58c981d5f /tests | |
parent | 4df3d2a36162f99ade57e209ce432733e082d2a5 (diff) | |
download | dotty-958e2a0f8b79402b1a430f0fe7802af9de583d71.tar.gz dotty-958e2a0f8b79402b1a430f0fe7802af9de583d71.tar.bz2 dotty-958e2a0f8b79402b1a430f0fe7802af9de583d71.zip |
Fixed type adaptation problem in checkBounds
We need to adapt type parameter bounds with an as-ssen-from to the
prefix of the type constructor.
Makes pos/boundspropagation pass.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/boundspropagation.scala | 18 |
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 + } + } +} + |