blob: a9860db9311ceb2c32e7c9e3da7f09aa0df7ee84 (
plain) (
tree)
|
|
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)
}
}
|