aboutsummaryrefslogtreecommitdiff
path: root/tests/run/OrType.scala
diff options
context:
space:
mode:
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)
+ }
+}