diff options
Diffstat (limited to 'tests/pending/run/t2296c')
-rw-r--r-- | tests/pending/run/t2296c/Action.java | 21 | ||||
-rw-r--r-- | tests/pending/run/t2296c/Display.java | 9 | ||||
-rw-r--r-- | tests/pending/run/t2296c/Global.java | 29 | ||||
-rw-r--r-- | tests/pending/run/t2296c/ScalaActivity.scala | 18 | ||||
-rw-r--r-- | tests/pending/run/t2296c/Test.scala | 15 | ||||
-rw-r--r-- | tests/pending/run/t2296c/a.scala | 5 |
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 + } +} |