aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/t845.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/t845.scala')
-rw-r--r--tests/untried/neg/t845.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/untried/neg/t845.scala b/tests/untried/neg/t845.scala
new file mode 100644
index 000000000..ddf6a16f3
--- /dev/null
+++ b/tests/untried/neg/t845.scala
@@ -0,0 +1,16 @@
+package test;
+
+object Test extends App {
+ type Bar;
+ trait FooImpl;
+
+ trait Bob {
+ def bar : Bar with FooImpl;
+ }
+ def ifn[A,B](a : A)(f : A => B) =
+ if (a != null) f(a) else null;
+
+ val bob : Bob = null;
+ val bar = ifn(bob)(_.bar);
+ assert(bar == null);
+}