diff options
Diffstat (limited to 'tests/neg/OrType.scala')
-rw-r--r-- | tests/neg/OrType.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/neg/OrType.scala b/tests/neg/OrType.scala new file mode 100644 index 000000000..a9860db93 --- /dev/null +++ b/tests/neg/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 // error + 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) + } +} |