diff options
author | liu fengyun <liufengyunchina@gmail.com> | 2016-09-01 14:55:01 +0200 |
---|---|---|
committer | liu fengyun <liufengyunchina@gmail.com> | 2016-09-01 14:55:01 +0200 |
commit | 9a5a51768d0f5bc0db9d91418be16a4e3b0e6937 (patch) | |
tree | 27fe5fb1eab33b58d31eba547821540a63ce0080 /tests/run/i1490.scala | |
parent | 5032f71013285885b37f799b13ac3ca1ea6a64ff (diff) | |
download | dotty-9a5a51768d0f5bc0db9d91418be16a4e3b0e6937.tar.gz dotty-9a5a51768d0f5bc0db9d91418be16a4e3b0e6937.tar.bz2 dotty-9a5a51768d0f5bc0db9d91418be16a4e3b0e6937.zip |
Fix #1490: type test of union types via type alias
Diffstat (limited to 'tests/run/i1490.scala')
-rw-r--r-- | tests/run/i1490.scala | 13 |
1 files changed, 13 insertions, 0 deletions
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 |