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