[NI] Fix adapting arguments for callable references with receivers

#KT-35912 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-01-20 13:35:56 +03:00
parent 43858e8169
commit 7bd7db839d
7 changed files with 61 additions and 1 deletions
@@ -0,0 +1,16 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KFunction2
class Foo
fun test(fn: KFunction2<Foo, Array<out String>, String>) = null
fun Foo.bar(vararg x: String) = ""
fun Foo.bar(vararg x: Int) = ""
fun actualTest() {
<!INAPPLICABLE_CANDIDATE!>test<!>(<!UNRESOLVED_REFERENCE!>Foo::bar<!>)
}
@@ -0,0 +1,16 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KFunction2
class Foo
fun test(fn: KFunction2<Foo, Array<out String>, String>) = null
fun Foo.bar(vararg x: String) = ""
fun Foo.bar(vararg x: Int) = ""
fun actualTest() {
test(Foo::bar)
}
@@ -0,0 +1,13 @@
package
public fun actualTest(): kotlin.Unit
public fun test(/*0*/ fn: kotlin.reflect.KFunction2<Foo, kotlin.Array<out kotlin.String>, kotlin.String>): kotlin.Nothing?
public fun Foo.bar(/*0*/ vararg x: kotlin.String /*kotlin.Array<out kotlin.String>*/): kotlin.String
public fun Foo.bar(/*0*/ vararg x: kotlin.Int /*kotlin.IntArray*/): kotlin.String
public final class Foo {
public constructor Foo()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}