aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/OrType.scala
blob: a9860db9311ceb2c32e7c9e3da7f09aa0df7ee84 (plain) (blame)
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  // 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)
  }
}