Skip to content

Commit c04eb15

Browse files
authored
Merge pull request #5375 from dotty-staging/test-#5374
Fix #5374: Test of type projections
2 parents f5b9572 + 196857f commit c04eb15

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/neg/type-projections.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class Test {
2+
type A
3+
4+
class Inner {
5+
type B
6+
type Balias = B
7+
type Aalias = A
8+
type Intalias = Int
9+
}
10+
11+
type T <: Inner
12+
type U = Inner
13+
14+
def x0: T#B = ??? // error
15+
def x1: T#Balias = ??? // error
16+
def x2: T#Aalias = ??? // error
17+
def x3: T#Intalias = ??? // error
18+
def y0: U#B = ??? // ok
19+
def y1: U#Balias = ??? // ok
20+
def y2: U#Aalias = ??? // ok
21+
def y3: U#Intalias = ??? // ok
22+
def z0: Inner#B = ??? // ok
23+
def z1: Inner#Balias = ??? // ok
24+
def z2: Inner#Aalias = ??? // ok
25+
def z3: Inner#Intalias = ??? // ok
26+
}

0 commit comments

Comments
 (0)