We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b38adea + 8fce073 commit 24331a9Copy full SHA for 24331a9
tests/neg/isRef.scala
@@ -0,0 +1,13 @@
1
+trait Foo {
2
+ type A = (Any { type T = Int })
3
+ type B = (Any { type S = String })
4
+ def a: A
5
+ def b: B
6
+ def aandb: A & B = b // error: found: B, required: A & B
7
+}
8
+trait Foo2 {
9
+ type A[_]
10
+ type B[_]
11
+ def b: B[Int]
12
+ def aandb: A[Int] & B[Int] = b // error: found: B[Int], required: A[Int] & B[Int]
13
tests/pos/isRef.scala
@@ -0,0 +1,12 @@
+ def aorb: A | B = b
+ def aorb: A[Int] | B[Int] = b
0 commit comments