From 9a5a51768d0f5bc0db9d91418be16a4e3b0e6937 Mon Sep 17 00:00:00 2001 From: liu fengyun Date: Thu, 1 Sep 2016 14:55:01 +0200 Subject: Fix #1490: type test of union types via type alias --- tests/run/i1490.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/run/i1490.scala (limited to 'tests/run/i1490.scala') diff --git a/tests/run/i1490.scala b/tests/run/i1490.scala new file mode 100644 index 000000000..554bc3940 --- /dev/null +++ b/tests/run/i1490.scala @@ -0,0 +1,13 @@ +class Base { + type T = Int | Boolean + def test(x: Object) = x.isInstanceOf[T] +} + +object Test { + def main(args: Array[String]) = { + val b = new Base + println(b.test(Int.box(3))) + println(b.test(Boolean.box(false))) + println(b.test(Double.box(3.4))) + } +} \ No newline at end of file -- cgit v1.2.3