summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/InterfaceCast.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pureJava/InterfaceCast.java')
-rw-r--r--tests/pureJava/InterfaceCast.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/pureJava/InterfaceCast.java b/tests/pureJava/InterfaceCast.java
new file mode 100644
index 000000000..cd4a77ce9
--- /dev/null
+++ b/tests/pureJava/InterfaceCast.java
@@ -0,0 +1,23 @@
+class A {}
+interface I {}
+class B extends A implements I {}
+
+public class InterfaceCast {
+
+ public static void main(String[] args) {}
+
+ void foo(A a, B b, I i) {
+ A a0 = a;
+ A a1 = b;
+ A a2 = (A)i;
+
+ B b0 = (B)a;
+ B b1 = b;
+ B b2 = (B)i;
+
+ I i0 = (I)a;
+ I i1 = b;
+ I i2 = i;
+ }
+}
+