diff options
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/escapingRefs.scala | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/pos/escapingRefs.scala b/tests/pos/escapingRefs.scala new file mode 100644 index 000000000..1b1deb8de --- /dev/null +++ b/tests/pos/escapingRefs.scala @@ -0,0 +1,42 @@ +class Outer { + class Inner { + class Inner2 + } +} + +class HasA { type A } + +class Foo[A] + +object Test { + def test = { + val a: Outer#Inner = { + val o = new Outer + new o.Inner + } + + val b: Outer#Inner#Inner2 = { + val o = new Outer + val i = new o.Inner + new i.Inner2 + } + + val c: HasA { type A = Int } = { + val h = new HasA { + type A = Int + } + val x: HasA { type A = h.A } = h + x + } + + val d: Foo[Int] = { + class Bar[B] extends Foo[B] + new Bar[Int] + } + + val e: Foo[_] = { + class Bar[B] extends Foo[B] + new Bar[Int]: Bar[_ <: Int] + } + } +} |