diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-31 17:20:02 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-08 16:55:56 +0200 |
commit | dd5341106d9b57a99316a26a1f0c7e195b6debf1 (patch) | |
tree | 2a555b335e2d661a828014e35e91e308fec4798e /tests/pos/unions.scala | |
parent | eb3df0db4a57d89c0d7370a9180742273db166b2 (diff) | |
download | dotty-dd5341106d9b57a99316a26a1f0c7e195b6debf1.tar.gz dotty-dd5341106d9b57a99316a26a1f0c7e195b6debf1.tar.bz2 dotty-dd5341106d9b57a99316a26a1f0c7e195b6debf1.zip |
Fleshed out Splitter phase
Implemented splitting operations
As a side effect, this contains a test ruling out structural term member dispatch.
Tests 0586 and 0625 which used structural dispatch got moved to neg.
Diffstat (limited to 'tests/pos/unions.scala')
-rw-r--r-- | tests/pos/unions.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pos/unions.scala b/tests/pos/unions.scala index 779d1847e..f358d6df9 100644 --- a/tests/pos/unions.scala +++ b/tests/pos/unions.scala @@ -2,13 +2,24 @@ 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)) + } |