summaryrefslogtreecommitdiff
path: root/test/files/pos/testcast.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/testcast.scala')
-rw-r--r--test/files/pos/testcast.scala23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/pos/testcast.scala b/test/files/pos/testcast.scala
new file mode 100644
index 0000000000..6482ed0a6d
--- /dev/null
+++ b/test/files/pos/testcast.scala
@@ -0,0 +1,23 @@
+package test;
+
+class A;
+
+class B {
+ def foo: int = 1;
+}
+
+class B1 {
+ def bar: int = 1
+}
+
+object C {
+ def view(x: B): B1 = null;
+}
+object Test {
+ import C.view;
+
+ val b: B = null;
+
+ System.out.println(C.view(b).bar);
+ System.out.println(b.bar);
+}