diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t6206.check | 4 | ||||
-rw-r--r-- | test/files/run/t6206.scala | 37 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/files/run/t6206.check b/test/files/run/t6206.check new file mode 100644 index 0000000000..8064573667 --- /dev/null +++ b/test/files/run/t6206.check @@ -0,0 +1,4 @@ +outer +outer +inner +inner diff --git a/test/files/run/t6206.scala b/test/files/run/t6206.scala new file mode 100644 index 0000000000..07ff246d02 --- /dev/null +++ b/test/files/run/t6206.scala @@ -0,0 +1,37 @@ +class Outer { + def apply( position : Inner ) {} + class Inner + + this.apply(new Inner) + this (new Inner) // error, +} + + +class Outer1 { + + self => + + def apply( position : Inner ) : String = "outer" + + class Inner( ) { + + def apply(arg: Inner): String = "inner" + + def testMe = { + List( + self.apply( this ), // a) this works + self( this ), // b) this does not work! + this apply this, + this(this) + ) foreach println + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + val o = new Outer1 + val i = new o.Inner + i.testMe + } +} |