From e32400681a1370b5279afdae3a5501311a6bc340 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Wed, 21 Nov 2007 14:28:19 +0000 Subject: Fixed ticket #10 --- test/files/jvm/protectedacc.check | 3 +++ test/files/jvm/protectedacc.scala | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'test/files/jvm') diff --git a/test/files/jvm/protectedacc.check b/test/files/jvm/protectedacc.check index 2479af69c0..aaac0d613e 100644 --- a/test/files/jvm/protectedacc.check +++ b/test/files/jvm/protectedacc.check @@ -1,9 +1,12 @@ 10 meth1(1) = 2 +meth1(1.0) = 2.0 meth2(1)(1) = prefix: 0 meth2(1)(1) = prefix: 0 meth3 = class [I 100 = 100 +id(1) = 1 +id('a') = a count before: 3 count after: 4 10 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; } } -- cgit v1.2.3