From 67dfced37f9b5d7a2b7f80f4da7fb5716f557350 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 4 Dec 2006 17:41:36 +0000 Subject: added infix type constructors added &: infix constructor for pairs optimization to remove redudant outer pointers --- test/files/neg/bug845.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/files/neg/bug845.scala (limited to 'test/files/neg/bug845.scala') diff --git a/test/files/neg/bug845.scala b/test/files/neg/bug845.scala new file mode 100644 index 0000000000..c8a2faa671 --- /dev/null +++ b/test/files/neg/bug845.scala @@ -0,0 +1,16 @@ +package test; + +object Test extends Application { + 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); +} -- cgit v1.2.3