aboutsummaryrefslogblamecommitdiff
path: root/tests/run/OrType.scala
blob: 9ab805defbdeaffd561c1da158d79c5f44d29dfc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
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)
  }
}