diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-11-21 14:28:19 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-11-21 14:28:19 +0000 |
commit | e32400681a1370b5279afdae3a5501311a6bc340 (patch) | |
tree | 153114fe793141a0a7cab4025de7864236d6a27b /test/files/jvm/protectedacc.scala | |
parent | 1bdf2c4ebf0a863756192d4879102710e839fec2 (diff) | |
download | scala-e32400681a1370b5279afdae3a5501311a6bc340.tar.gz scala-e32400681a1370b5279afdae3a5501311a6bc340.tar.bz2 scala-e32400681a1370b5279afdae3a5501311a6bc340.zip |
Fixed ticket #10
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; } } |