From 6b142c2217096e262e52c06753ad520a2eab054a Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Thu, 2 Nov 2006 11:10:44 +0000 Subject: Added a value for Java static inner classes to ... Added a value for Java static inner classes to allow access to static members. --- test/files/jvm/lib/nest.jar.desired.sha1 | 1 + test/files/jvm/nest.check | 3 +++ test/files/jvm/nest.java | 17 +++++++++++++++++ test/files/jvm/nest.scala | 17 +++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 test/files/jvm/lib/nest.jar.desired.sha1 create mode 100644 test/files/jvm/nest.check create mode 100644 test/files/jvm/nest.java create mode 100644 test/files/jvm/nest.scala (limited to 'test/files') diff --git a/test/files/jvm/lib/nest.jar.desired.sha1 b/test/files/jvm/lib/nest.jar.desired.sha1 new file mode 100644 index 0000000000..b9b4065db6 --- /dev/null +++ b/test/files/jvm/lib/nest.jar.desired.sha1 @@ -0,0 +1 @@ +4141e6f277e97f81079f81910a7b2b4d6c0127b7 ?nest.jar diff --git a/test/files/jvm/nest.check b/test/files/jvm/nest.check new file mode 100644 index 0000000000..445369969e --- /dev/null +++ b/test/files/jvm/nest.check @@ -0,0 +1,3 @@ +2 +3 +10 diff --git a/test/files/jvm/nest.java b/test/files/jvm/nest.java new file mode 100644 index 0000000000..dfb011732c --- /dev/null +++ b/test/files/jvm/nest.java @@ -0,0 +1,17 @@ +package a; + + +/** This file is needed for test 'nest.scala'. It should + * be compiled with javac and packaged into lib/nest.jar + */ +public class nest { + public static class best { + public static class rest { + public static rest test = new rest(); + public static int x = 10; + public int inc(int i) { + return i + 1; + } + } + } +} diff --git a/test/files/jvm/nest.scala b/test/files/jvm/nest.scala new file mode 100644 index 0000000000..ebd3ee490a --- /dev/null +++ b/test/files/jvm/nest.scala @@ -0,0 +1,17 @@ +//############################################################################ +// Test Scala interaction with Java nested classes and static members. +//############################################################################ +// $Id: inner.scala 8902 2006-10-10 10:58:10 +0200 (Tue, 10 Oct 2006) mihaylov $ + +/** found in nest.jar, compiled from nest.java */ +import a._; + +object Test extends Application { + val x = nest.best.rest.test + Console.println(x.inc(1)) + + val o = new nest.best; + val r = new nest.best.rest; + Console.println(nest.best.rest.test.inc(2)) + Console.println(nest.best.rest.x) +} -- cgit v1.2.3