aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-06 08:47:08 +0200
committerMartin Odersky <odersky@gmail.com>2014-09-06 08:47:08 +0200
commite1040935cbcc1d767933c38a141372538ef63ac2 (patch)
treed2f05fa2319fe80a76f660e043d42a06d5e9ba8a /tests/pos
parent44bdec1a44db7ac880183e0c70b5f5668048961e (diff)
downloaddotty-e1040935cbcc1d767933c38a141372538ef63ac2.tar.gz
dotty-e1040935cbcc1d767933c38a141372538ef63ac2.tar.bz2
dotty-e1040935cbcc1d767933c38a141372538ef63ac2.zip
Better tests and more fixes for ExplicitOuter
Now also testing that after erasure no outer this exists. Tests suit now includes calls to local classes and methods which need an outer pointer, as well as passing an outer pointer along a secondary constructor.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/explicitOuter.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/explicitOuter.scala b/tests/pos/explicitOuter.scala
index a5fb1dd70..44b441956 100644
--- a/tests/pos/explicitOuter.scala
+++ b/tests/pos/explicitOuter.scala
@@ -5,6 +5,7 @@ class Outer(elem: Int, val next: Outer) {
}
class InnerClass(x: Int) extends next.InnerTrait {
+ def this() = this(3)
def bar = elem + x
}
@@ -18,6 +19,7 @@ class Outer(elem: Int, val next: Outer) {
}
class InnerClass(x: Int) extends next.InnerTrait {
+ def this() = this(3)
def bar = elem + x
}
@@ -33,6 +35,18 @@ class Outer(elem: Int, val next: Outer) {
val ec = new EmptyInnerClass
}
+ def inner2 = {
+ class C {
+ val x = elem
+ }
+ class D {
+ new C
+ }
+ class E {
+ f()
+ }
+ def f() = ()
+ }
}
object Test extends App {