From 196857f80818555c4e1ecaf060843a2cb68b328d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 2 Nov 2018 17:05:20 +0100 Subject: [PATCH] Test of type projections --- tests/neg/type-projections.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/neg/type-projections.scala diff --git a/tests/neg/type-projections.scala b/tests/neg/type-projections.scala new file mode 100644 index 000000000000..42b3d94f9b3f --- /dev/null +++ b/tests/neg/type-projections.scala @@ -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 +} \ No newline at end of file