Skip to content

Fix #5374: Test of type projections #5375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/neg/type-projections.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class Test {
type A

class Inner {
type B
type Balias = B
type Aalias = A
type Intalias = Int
}

type T <: Inner
type U = Inner

def x0: T#B = ??? // error
def x1: T#Balias = ??? // error
def x2: T#Aalias = ??? // error
def x3: T#Intalias = ??? // error
def y0: U#B = ??? // ok
def y1: U#Balias = ??? // ok
def y2: U#Aalias = ??? // ok
def y3: U#Intalias = ??? // ok
def z0: Inner#B = ??? // ok
def z1: Inner#Balias = ??? // ok
def z2: Inner#Aalias = ??? // ok
def z3: Inner#Intalias = ??? // ok
}