diff options
author | Martin Odersky <odersky@gmail.com> | 2015-03-05 14:13:33 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-18 11:14:15 +0100 |
commit | cf79474621e2272e3cdc1c670a39bb22232f90cc (patch) | |
tree | 7c398b7bbb911c73b7e6aeb52a7ef28cd7dd2773 /tests/pos/pickleOK/unions.scala | |
parent | 321563940dee1716c19600efd57acb9ed83a7687 (diff) | |
download | dotty-cf79474621e2272e3cdc1c670a39bb22232f90cc.tar.gz dotty-cf79474621e2272e3cdc1c670a39bb22232f90cc.tar.bz2 dotty-cf79474621e2272e3cdc1c670a39bb22232f90cc.zip |
Fix TastyReader#readLongInt
Diffstat (limited to 'tests/pos/pickleOK/unions.scala')
-rw-r--r-- | tests/pos/pickleOK/unions.scala | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/pos/pickleOK/unions.scala b/tests/pos/pickleOK/unions.scala new file mode 100644 index 000000000..22e6391e3 --- /dev/null +++ b/tests/pos/pickleOK/unions.scala @@ -0,0 +1,33 @@ +object unions { + + class A { + def f: String = "abc" + + def g(x: Int): Int = x + def g(x: Double): Double = x + } + + class B { + def f: String = "bcd" + + def g(x: Int) = -x + def g(x: Double): Double = -x + } + + val x: A | B = if (true) new A else new B + def y: B | A = if (true) new A else new B + println(x.f) + println(x.g(2)) + println(y.f) + println(y.g(1.0)) + println(y.g(1.0f)) + + class C { + private def foo = 0 + class D extends C { + private def foo = 1 + def test(cd: C | D, dc: D | C) = (cd.foo, dc.foo) + } + } + +} |