// !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER // Test case 1: additional receiver, generic invoke class Foo1 class Bar1(val value: Foo1) class Another1 { operator fun Foo1.invoke(handler: () -> Unit) {} } fun Another1.main(x: Bar1?) { x?.value {} x?.value.invoke({}) } // Test case 2: additional receiver, non-generic invoke class Foo2 class Bar2(val value: Foo2) class Another2 { operator fun Foo2.invoke(x: Int) {} } fun Another2.main(x: Bar2?) { x?.value(1) x?.value.invoke(1) } // Test case 3: additional generic receiver, generic invoke class Foo3 class Bar3(val value: Foo3) class Another3 { operator fun Foo3.invoke(x: Int) {} } fun Another3.main(x: Bar3?) { x?.value(1) x?.value.invoke(1) } // Test case 4: additional receiver, generic invoke with nullable receiver class Foo4 class Bar4(val value: Foo4) class Another4 { operator fun Foo4?.invoke(x: Int) {} } fun Another4.main(x: Bar4?) { x?.value(1) x?.value.invoke(1) } // Test case 5: additional receiver, generic invoke without using a type parameter inside a recevier class Foo5 class Bar5(val value: Foo5) class Another5 { operator fun Foo5.invoke(handler: T) {} } fun Another5.main(x: Bar5?) { x?.value {} x?.value.invoke({}) } // Test case 6: top-level generic invoke class Foo6 class Bar6(val value: Foo6) operator fun Foo6.invoke(x: Int) {} fun main(x: Bar6?) { x?.value(1) x?.value.invoke(1) } // Test case 7: top-level generic invoke and invoke with compatible additional dispatch recevier class Foo7 class Bar7(val value: Foo7) class Another7 { operator fun Foo7.invoke(x: Int) {} } operator fun Foo7.invoke(x: Int) {} fun Another7.main(x: Bar7?) { x?.value(1) x?.value.invoke(1) } // Test case 8: top-level non-generic invoke class Foo8 class Bar8(val value: Foo8) operator fun Foo8.invoke(x: Int) {} fun main(x: Bar8?) { x?.value(1) x?.value.invoke(1) } // Test case 9: additional receiver, generic invoke with pure type perameter receiver class Foo9 class Bar9(val value: Foo9) class Another9 { operator fun T.invoke(handler: () -> Unit) {} } fun Another9.main(x: Bar9?) { x?.value {} x?.value.invoke({}) } // Test case 10: additional receiver, generic invoke with upper bound class Foo10 class Bar10(val value: Foo10) class Another10 { operator fun Foo10.invoke(handler: () -> Unit) {} } fun Another10.main(x: Bar10?) { x?.value {} x?.value.invoke({}) }