1 2 3 4 5 6 7 8 9
object O { class A class B def f[T](x: T, y: T): T = x val x: A = f(new A { }, new A) val y: A | B = f(new A { }, new B) }