summaryrefslogtreecommitdiff
path: root/test/files/jvm
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2008-09-01 13:56:12 +0000
committerIulian Dragos <jaguarul@gmail.com>2008-09-01 13:56:12 +0000
commit4b6277f8511bab6d4d0fc01f398bd9e967b94bdb (patch)
tree5f19a4128de401b769afd39b8e99f321fba4e1f9 /test/files/jvm
parent906248a4b2dc4275a91c335af9d214aa883d1037 (diff)
downloadscala-4b6277f8511bab6d4d0fc01f398bd9e967b94bdb.tar.gz
scala-4b6277f8511bab6d4d0fc01f398bd9e967b94bdb.tar.bz2
scala-4b6277f8511bab6d4d0fc01f398bd9e967b94bdb.zip
Fixed #1315, outer instances are passed implici...
Fixed #1315, outer instances are passed implicitly. Reorganized nested classes tests.
Diffstat (limited to 'test/files/jvm')
-rw-r--r--test/files/jvm/OuterTParams.java6
-rw-r--r--test/files/jvm/nest.check1
-rw-r--r--test/files/jvm/nest.java21
-rw-r--r--test/files/jvm/nest.scala10
4 files changed, 26 insertions, 12 deletions
diff --git a/test/files/jvm/OuterTParams.java b/test/files/jvm/OuterTParams.java
deleted file mode 100644
index 1d3db49fcf..0000000000
--- a/test/files/jvm/OuterTParams.java
+++ /dev/null
@@ -1,6 +0,0 @@
-public class OuterTParams<A> {
- class InnerClass {
- // Cannot parse method signature: "()TA;"
- public A method() { return null; }
- }
-}
diff --git a/test/files/jvm/nest.check b/test/files/jvm/nest.check
index 445369969e..dc63855b14 100644
--- a/test/files/jvm/nest.check
+++ b/test/files/jvm/nest.check
@@ -1,3 +1,4 @@
2
3
10
+Instantiating public inner class: Inn Outer name x: 42
diff --git a/test/files/jvm/nest.java b/test/files/jvm/nest.java
index 581eaa4972..3f6f0bebbd 100644
--- a/test/files/jvm/nest.java
+++ b/test/files/jvm/nest.java
@@ -14,4 +14,25 @@ public class nest {
}
}
}
+
+
+ String name = "Outer name";
+
+ public class Inn {
+ int x;
+
+ public Inn(int x) {
+ this.x = x;
+ }
+
+ public void doSomething() {
+ System.out.println("Inn " + name + " x: " + x);
+ }
+ }
+
+ protected class ProtInn {
+ public void doSomething() {
+ System.out.println("ProtInn " + name);
+ }
+ }
}
diff --git a/test/files/jvm/nest.scala b/test/files/jvm/nest.scala
index 71f6064f31..60f3a3155f 100644
--- a/test/files/jvm/nest.scala
+++ b/test/files/jvm/nest.scala
@@ -14,11 +14,9 @@ object Test extends Application {
val r = new nest.best.rest;
Console.println(nest.best.rest.test.inc(2))
Console.println(nest.best.rest.x)
-}
-// bug #695
-object ForceParse extends OuterTParams[AnyRef] {
- // Force import of HarderToParse<A>.InnerClass,
- // which has confusing method signature.
- var field: InnerClass = null
+ print("Instantiating public inner class: ")
+ val outer = new nest
+ val inn = new outer.Inn(42)
+ inn.doSomething
}