summaryrefslogblamecommitdiff
path: root/test/files/pos/t845.scala
blob: ddf6a16f326ac50ee3abb869cde8d5ce728f402b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13

             
                         









                                   
                            

                      
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);
}