aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/intersection.scala
blob: a4c19b5af406aa1d66edd35c3e1fc87ffa07a98c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
                                












                                      


                            
import dotty.language.keepUnions
object intersection {

  class A
  class B

  val x: A => Unit = ???
  val y: B => Unit = ???

  val z = if (???) x else y

  val a: A & B => Unit = z
  val b: (A => Unit) | (B => Unit) = z

  type needsA = A => Nothing
  type needsB = B => Nothing
}