diff options
Diffstat (limited to 'test/files/jvm/protectedacc.scala')
-rw-r--r-- | test/files/jvm/protectedacc.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/jvm/protectedacc.scala b/test/files/jvm/protectedacc.scala index fc6d5336d4..f5d05e21b4 100644 --- a/test/files/jvm/protectedacc.scala +++ b/test/files/jvm/protectedacc.scala @@ -29,9 +29,12 @@ package p { protected val x = 10; protected def meth1(x: Int) = x + 1; + protected def meth1(x: Double) = x + 1 protected def meth2(x: Int)(y: String) = y + (x - 1); protected def meth3 = Array(1, 2) + protected def f[a](x: a) = x + def getA: this.type = this; } @@ -78,6 +81,7 @@ package p { def m = { Console.println(x); Console.println("meth1(1) = " + meth1(1)); + Console.println("meth1(1.0) = " + meth1(1.0)); // test accesses from closures for (val x <- 1 until 3) Console.println("meth2(1)(1) = " + meth2(1)("prefix: ")); @@ -87,6 +91,9 @@ package p { val inc = meth2(1)_; Console.println("100 = " + inc("10")); + Console.println("id(1) = " + f(1)) + Console.println("id('a') = " + f("a")) + getA.x; } } |