aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/intersection.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/intersection.scala')
-rw-r--r--tests/pos/intersection.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/intersection.scala b/tests/pos/intersection.scala
new file mode 100644
index 000000000..2b9f6c0b7
--- /dev/null
+++ b/tests/pos/intersection.scala
@@ -0,0 +1,19 @@
+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
+}