From 5eecd806e8533b745b78d418e6598b1f71b0c29d Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Tue, 17 Apr 2018 16:37:27 +0200 Subject: [PATCH] Fix #782: Add regression test --- tests/pos/i782.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/pos/i782.scala diff --git a/tests/pos/i782.scala b/tests/pos/i782.scala new file mode 100644 index 000000000000..ed2bd61b5579 --- /dev/null +++ b/tests/pos/i782.scala @@ -0,0 +1,15 @@ +class M + +class A extends M +class B extends M + +class Foo[T](x: T) { + def foo[S >: T](other: S): Foo[S] = ??? +} + +object C { + def xy() = { + val x: Foo[A] = new Foo(new A) + x.foo(new B) + } +}