summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t4283.check5
-rw-r--r--test/files/run/t4283/AbstractFoo.java6
-rw-r--r--test/files/run/t4283/ScalaBipp.scala5
-rw-r--r--test/files/run/t4283/Test.scala16
-rw-r--r--test/files/run/t5162.scala19
5 files changed, 51 insertions, 0 deletions
diff --git a/test/files/run/t4283.check b/test/files/run/t4283.check
new file mode 100644
index 0000000000..0d27989761
--- /dev/null
+++ b/test/files/run/t4283.check
@@ -0,0 +1,5 @@
+2
+2
+1
+1
+1
diff --git a/test/files/run/t4283/AbstractFoo.java b/test/files/run/t4283/AbstractFoo.java
new file mode 100644
index 0000000000..0403271b74
--- /dev/null
+++ b/test/files/run/t4283/AbstractFoo.java
@@ -0,0 +1,6 @@
+package test;
+
+/* package private */ class AbstractFoo {
+ public int t = 1;
+ public int f() { return 2; }
+} \ No newline at end of file
diff --git a/test/files/run/t4283/ScalaBipp.scala b/test/files/run/t4283/ScalaBipp.scala
new file mode 100644
index 0000000000..36dea9f4de
--- /dev/null
+++ b/test/files/run/t4283/ScalaBipp.scala
@@ -0,0 +1,5 @@
+package test
+
+class ScalaBipp extends AbstractFoo {
+ def make: Option[ScalaBipp] = Option(this)
+}
diff --git a/test/files/run/t4283/Test.scala b/test/files/run/t4283/Test.scala
new file mode 100644
index 0000000000..af72fa62f9
--- /dev/null
+++ b/test/files/run/t4283/Test.scala
@@ -0,0 +1,16 @@
+object Test {
+
+ def main(args: Array[String]) {
+ val x = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].f()
+ println(x)
+ val y = (new test.ScalaBipp).make.get.f()
+ println(y)
+ val u = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].t
+ println(u)
+ val v = (new test.ScalaBipp).make.get.t
+ println(v)
+ val sb: test.ScalaBipp = (new test.ScalaBipp).make.get
+ val z = sb.t
+ println(z)
+ }
+}
diff --git a/test/files/run/t5162.scala b/test/files/run/t5162.scala
new file mode 100644
index 0000000000..4f91932b6e
--- /dev/null
+++ b/test/files/run/t5162.scala
@@ -0,0 +1,19 @@
+// In run, rather than pos, to check for problems like SI-4283
+object O1 {
+ private[O1] class Base {
+ def foo: Int = 0
+ }
+ class Mediator extends Base
+}
+
+object O2 {
+ class Derived extends O1.Mediator {
+ override def foo: Int = super.foo
+ }
+}
+
+object Test {
+ def main(args: Array[String]) {
+ new O2.Derived().foo
+ }
+}