// LANGUAGE: +SafeCallsAreAlwaysNullable // ISSUE: KT-46860 interface A { fun foo(): Int } fun takeInt(x: Int) {} fun test_1(a: A) { val x = a?.foo() takeInt(x) // should be an error } fun test_2(a: A?) { if (a != null) { val x = a?.foo() takeInt(x) // should be an error } }