// !DIAGNOSTICS: -UNUSED_PARAMETER -FINAL_UPPER_BOUND import kotlin.reflect.* interface Foo { fun resolve(var1: Int): String fun resolve(var1: String): String suspend fun resolve2(var1: Int): String suspend fun resolve2(var1: String): String val Int.x1 get() = "" val String.x1 get() = "" var Int.x2 get() = "" set(value) {} var String.x2 get() = "" set(value) {} val Int.x3 get() = "" var String.x3 get() = "" set(value) {} // CR on property with to receivers are forbidden fun test() { // with LHS and property bar8(Foo::x1) bar8(Foo::x1) bar8(Foo::x1) // with LHS and mutable property bar8(Foo::x2) bar8(Foo::x2) bar8(Foo::x2) // with LHS and propery + mutable property (mixed) bar8(Foo::x3) bar8(Foo::x3) bar8(Foo::x3) bar9(Foo::x3) bar9(Foo::x3) bar9(Foo::x3) } } val Int.x1 get() = "" val String.x1 get() = "" fun bar1(f: KFunction2) {} fun bar2(f: KFunction2<out K, String, String>) {} fun bar3(f: Any?) {} fun bar4(f: Function2) {} fun bar5(f: suspend (K, String) -> String) {} fun bar6(f: KSuspendFunction2) {} fun bar7(f: K.(String) -> String) {} fun bar8(f: KProperty2) {} fun bar9(f: KMutableProperty2) {} fun bar10(f: KProperty1) {} fun resolve(var2: Number, var1: Int) = "" fun resolve(var2: Number, var1: String) = "" fun main() { // with LHS bar1(Foo::resolve) // ERROR before the fix in NI bar1(Foo::resolve) // OK bar1(Foo::resolve) // OK // without LHS bar1(::resolve) // OK bar1(::resolve) // OK bar1(::resolve) // OK // with LHS and conflicting projection bar2(Foo::resolve) bar2(Foo::resolve) bar2(Foo::resolve) // with LHS and Any? expected type bar3(Foo::resolve) bar3(Foo::resolve) bar3(Foo::resolve) // with LHS and `Function` expected type bar4(Foo::resolve) // ERROR before the fix in NI bar4(Foo::resolve) // OK bar4(Foo::resolve) // OK // with LHS and `SuspendFunction` expected type bar5(Foo::resolve2) // ERROR before the fix in NI bar5(Foo::resolve2) // OK bar5(Foo::resolve2) // OK // with LHS and `KSuspendFunction` expected type bar6(Foo::resolve2) // ERROR before the fix in NI bar6(Foo::resolve2) // OK bar6(Foo::resolve2) // OK // with LHS and sentension function expected type bar7(Foo::resolve) // ERROR before the fix in NI bar7(Foo::resolve) // OK bar7(Foo::resolve) // OK // with LHS and sentension function expected type bar10(Int::x1) // ERROR before the fix in NI bar10(Int::x1) // OK bar10(Int::x1) // OK fun Int.ext() { // with LHS and sentension function expected type bar10(; KProperty0")!>::x1) // ERROR before the fix in NI bar10(; KProperty0")!>::x1) // OK bar10(; KProperty0")!>::x1) // OK } }