aboutsummaryrefslogtreecommitdiff
path: root/tests/run/OrType.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-09-15 18:11:35 +0200
committerMartin Odersky <odersky@gmail.com>2015-09-17 12:41:15 +0200
commit4966589b7d09f1650bf2df461ba3c6461552a0e3 (patch)
treec2defaa973db7f4e4538f763cfa0faa5fb80dd99 /tests/run/OrType.scala
parent50e3a7d92f4b7cc4cd922eb92c7ed8bf793b159c (diff)
downloaddotty-4966589b7d09f1650bf2df461ba3c6461552a0e3.tar.gz
dotty-4966589b7d09f1650bf2df461ba3c6461552a0e3.tar.bz2
dotty-4966589b7d09f1650bf2df461ba3c6461552a0e3.zip
Fix #791 erasedLub of two AnyVals is Object.
Diffstat (limited to 'tests/run/OrType.scala')
-rw-r--r--tests/run/OrType.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run/OrType.scala b/tests/run/OrType.scala
new file mode 100644
index 000000000..9ab805def
--- /dev/null
+++ b/tests/run/OrType.scala
@@ -0,0 +1,11 @@
+class B(val x: Int)
+class C(val x: Double)
+
+object Test{
+ def bar(x: B | C): Int | Double = x.x
+ def main(args: Array[String]): Unit = {
+ val b = new B(1)
+ val c = new C(1)
+ bar(if (b.hashCode > c.hashCode) b else c)
+ }
+}