summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-02-01 13:32:48 -0800
committerJames Iry <jamesiry@gmail.com>2013-02-01 13:32:48 -0800
commit283924bfa5c266ccaea1bdb87521581e1ceb38cd (patch)
tree688cb14ae0e4428be194214a775a72057cf174f5 /test/files
parentcabf626bbc49a897e581fbf6ceaa79ffb191bfec (diff)
parent11ac963c811f2a9a00fac5bb874efeaab35c4041 (diff)
downloadscala-283924bfa5c266ccaea1bdb87521581e1ceb38cd.tar.gz
scala-283924bfa5c266ccaea1bdb87521581e1ceb38cd.tar.bz2
scala-283924bfa5c266ccaea1bdb87521581e1ceb38cd.zip
Merge pull request #1979 from retronym/backport/1499
[backport] Fix for SI-6206, inconsistency with apply.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/t6206.check4
-rw-r--r--test/files/run/t6206.scala37
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
+ }
+}