class C [A] { f : A; foo () : void { when (f != null) // E: comparing a value type A.* to .*null {} } foo[B] (f : void -> B) : void { when (f () != null) // E: comparing a value type B.* to .*null {} } }