From 7ead0b0d41854e1846faa24996c11d9d832301bb Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 8 Aug 2018 18:39:55 +0200 Subject: [PATCH] Fix #3500: Add regression test --- tests/pos/i3500.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/pos/i3500.scala diff --git a/tests/pos/i3500.scala b/tests/pos/i3500.scala new file mode 100644 index 000000000000..bedc3567e954 --- /dev/null +++ b/tests/pos/i3500.scala @@ -0,0 +1,10 @@ +trait Map2[K] { + def get(k: K): K = k + def foo: K = { + this match { + case that: Map2[b] => that.get(3.asInstanceOf[b]) + case that: Map2[b] => that.get(3.asInstanceOf[K]) + case _ => get(5.asInstanceOf[K]) + } + } +}