Skip to content

Commit 24331a9

Browse files
Merge pull request #5291 from dotty-staging/add-regression-tests-#1593
Add regression tests for #1593
2 parents b38adea + 8fce073 commit 24331a9

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/neg/isRef.scala

+13
Original file line numberDiff line numberDiff line change
@@ -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

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
trait Foo {
2+
type A = (Any { type T = Int })
3+
type B = (Any { type S = String })
4+
def b: B
5+
def aorb: A | B = b
6+
}
7+
trait Foo2 {
8+
type A[_]
9+
type B[_]
10+
def b: B[Int]
11+
def aorb: A[Int] | B[Int] = b
12+
}

0 commit comments

Comments
 (0)