summaryrefslogtreecommitdiff
path: root/test/files
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
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')
-rw-r--r--test/files/jvm/nest.check1
-rw-r--r--test/files/jvm/nest.java21
-rw-r--r--test/files/jvm/nest.scala10
-rw-r--r--test/files/jvm5/OuterTParams.java (renamed from test/files/jvm/OuterTParams.java)0
-rw-r--r--test/files/jvm5/genericNest.scala13
-rw-r--r--test/files/lib/genericNest.jar.desired.sha11
-rw-r--r--test/files/lib/nest.jar.desired.sha12
7 files changed, 41 insertions, 7 deletions
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
}
diff --git a/test/files/jvm/OuterTParams.java b/test/files/jvm5/OuterTParams.java
index 1d3db49fcf..1d3db49fcf 100644
--- a/test/files/jvm/OuterTParams.java
+++ b/test/files/jvm5/OuterTParams.java
diff --git a/test/files/jvm5/genericNest.scala b/test/files/jvm5/genericNest.scala
new file mode 100644
index 0000000000..c1b0210117
--- /dev/null
+++ b/test/files/jvm5/genericNest.scala
@@ -0,0 +1,13 @@
+/** found in genericNest.jar, compiled from OuterTParams.java */
+import nestpkg._;
+
+// bug #695
+object ForceParse extends OuterTParams[AnyRef] {
+ // Force import of HarderToParse<A>.InnerClass,
+ // which has confusing method signature.
+ var field: InnerClass = null
+}
+
+object Test extends Application {
+ ForceParse
+}
diff --git a/test/files/lib/genericNest.jar.desired.sha1 b/test/files/lib/genericNest.jar.desired.sha1
new file mode 100644
index 0000000000..e9321262f2
--- /dev/null
+++ b/test/files/lib/genericNest.jar.desired.sha1
@@ -0,0 +1 @@
+b1ec8a095cec4902b3609d74d274c04365c59c04 ?genericNest.jar
diff --git a/test/files/lib/nest.jar.desired.sha1 b/test/files/lib/nest.jar.desired.sha1
index 02b9867d48..674ca79a5b 100644
--- a/test/files/lib/nest.jar.desired.sha1
+++ b/test/files/lib/nest.jar.desired.sha1
@@ -1 +1 @@
-0a3f0201e670f6063095e0fc33602afb5f1c1b07 ?nest.jar
+cd33e0a0ea249eb42363a2f8ba531186345ff68c ?nest.jar