aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/t2296c
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
commit89bacb9c25a58454ff1878e67f7ea07ffc8c269f (patch)
tree51f1ff6c66aebe1b6109b1cffcc2bb8e4cf760a3 /tests/pending/run/t2296c
parenta0fa33deafbea1bf53edc068c5ed9db5592822f9 (diff)
downloaddotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.gz
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.bz2
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.zip
Run tests as they were in scala.
Diffstat (limited to 'tests/pending/run/t2296c')
-rw-r--r--tests/pending/run/t2296c/Action.java21
-rw-r--r--tests/pending/run/t2296c/Display.java9
-rw-r--r--tests/pending/run/t2296c/Global.java29
-rw-r--r--tests/pending/run/t2296c/ScalaActivity.scala18
-rw-r--r--tests/pending/run/t2296c/Test.scala15
-rw-r--r--tests/pending/run/t2296c/a.scala5
6 files changed, 97 insertions, 0 deletions
diff --git a/tests/pending/run/t2296c/Action.java b/tests/pending/run/t2296c/Action.java
new file mode 100644
index 000000000..4a6b69a5b
--- /dev/null
+++ b/tests/pending/run/t2296c/Action.java
@@ -0,0 +1,21 @@
+package bug.action;
+
+import bug.Global;
+
+public abstract class Action {
+ protected Global m_glob;
+
+ public Action(Global glob0) {
+ m_glob = glob0;
+ }
+
+ public Action() {
+ this(null);
+ }
+
+ public abstract void run(int v);
+
+ public void setGlobal(Global g) {
+ m_glob = g;
+ }
+}
diff --git a/tests/pending/run/t2296c/Display.java b/tests/pending/run/t2296c/Display.java
new file mode 100644
index 000000000..7f7e6a73d
--- /dev/null
+++ b/tests/pending/run/t2296c/Display.java
@@ -0,0 +1,9 @@
+package bug;
+
+public class Display {
+ protected Global m_glob;
+
+ public void start() {
+ m_glob.runActions();
+ }
+}
diff --git a/tests/pending/run/t2296c/Global.java b/tests/pending/run/t2296c/Global.java
new file mode 100644
index 000000000..7e5a762de
--- /dev/null
+++ b/tests/pending/run/t2296c/Global.java
@@ -0,0 +1,29 @@
+package bug;
+
+import bug.action.Action;
+import java.util.List;
+import java.util.LinkedList;
+
+public class Global {
+ public int items() {
+ return 0;
+ }
+
+ public int items(int i) {
+ return i + ls.size();
+ }
+
+ private List<Action> ls = new LinkedList<Action>();
+
+ public void putAction(Action a) {
+ a.setGlobal(this);
+ ls.add(a);
+ }
+
+ public void runActions() {
+ for (Action action: ls) {
+ System.out.println("RUNNING ACTION");
+ action.run(0);
+ }
+ }
+}
diff --git a/tests/pending/run/t2296c/ScalaActivity.scala b/tests/pending/run/t2296c/ScalaActivity.scala
new file mode 100644
index 000000000..aa7648a94
--- /dev/null
+++ b/tests/pending/run/t2296c/ScalaActivity.scala
@@ -0,0 +1,18 @@
+package test
+
+import bug.Display
+import bug.action.Action
+
+abstract class Outer extends Display {
+
+ def init() {
+ m_glob.putAction(ScalaActivity)
+ }
+
+ object ScalaActivity extends Action {
+ def run(v: Int) {
+ val testSet = List(1,2,3)
+ testSet.map(p => m_glob.items(p)) // crash with illegal access
+ }
+ }
+}
diff --git a/tests/pending/run/t2296c/Test.scala b/tests/pending/run/t2296c/Test.scala
new file mode 100644
index 000000000..1132bebeb
--- /dev/null
+++ b/tests/pending/run/t2296c/Test.scala
@@ -0,0 +1,15 @@
+package test
+
+import bug.Global
+
+object Test {
+ def main(args: Array[String]) {
+ val m = new Main()
+ m.init()
+ m.start()
+ }
+}
+
+class Main extends Outer {
+ m_glob = new Global()
+}
diff --git a/tests/pending/run/t2296c/a.scala b/tests/pending/run/t2296c/a.scala
new file mode 100644
index 000000000..fae32f4ec
--- /dev/null
+++ b/tests/pending/run/t2296c/a.scala
@@ -0,0 +1,5 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ test.Test main args
+ }
+}