[Tests] Add test for vararg callable reference adaption with typealias

#KT-65817 Fixed
This commit is contained in:
Kirill Rakhman
2024-02-16 13:43:08 +01:00
committed by Space Team
parent 365973f03a
commit 9606a5a441
3 changed files with 25 additions and 0 deletions
@@ -1,6 +1,10 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(vararg ints: Int) {}
typealias MyInt = Int
fun fooAlias(vararg ints: MyInt) {}
fun test(i: IntArray) {
myLet(i, ::foo)
myLet(::foo)
@@ -8,6 +12,13 @@ fun test(i: IntArray) {
myLet<IntArray>(::foo)
myLetExplicit1(::foo)
myLetExplicit2(::foo)
myLet(i, ::fooAlias)
myLet(::fooAlias)
myLet<Int>(::<!INAPPLICABLE_CANDIDATE!>fooAlias<!>)
myLet<IntArray>(::fooAlias)
myLetExplicit1(::fooAlias)
myLetExplicit2(::fooAlias)
}
fun <T> myLet(t: T, block: (T) -> Unit) {}
@@ -1,6 +1,10 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(vararg ints: Int) {}
typealias MyInt = Int
fun fooAlias(vararg ints: MyInt) {}
fun test(i: IntArray) {
myLet(i, ::foo)
myLet(::foo)
@@ -8,6 +12,13 @@ fun test(i: IntArray) {
myLet<IntArray>(::foo)
myLetExplicit1(::foo)
myLetExplicit2(::foo)
myLet(i, ::fooAlias)
myLet(::fooAlias)
myLet<Int>(<!TYPE_MISMATCH!>::fooAlias<!>)
myLet<IntArray>(::fooAlias)
myLetExplicit1(::fooAlias)
myLetExplicit2(::fooAlias)
}
fun <T> myLet(t: T, block: (T) -> Unit) {}
@@ -1,8 +1,11 @@
package
public fun foo(/*0*/ vararg ints: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public fun fooAlias(/*0*/ vararg ints: MyInt /* = kotlin.Int */ /*kotlin.IntArray*/): kotlin.Unit
public fun </*0*/ T> myLet(/*0*/ block: (T) -> kotlin.Unit): kotlin.Unit
public fun </*0*/ T> myLet(/*0*/ t: T, /*1*/ block: (T) -> kotlin.Unit): kotlin.Unit
public fun myLetExplicit1(/*0*/ block: (kotlin.Int) -> kotlin.Unit): kotlin.Unit
public fun myLetExplicit2(/*0*/ block: (kotlin.IntArray) -> kotlin.Unit): kotlin.Unit
public fun test(/*0*/ i: kotlin.IntArray): kotlin.Unit
public typealias MyInt = kotlin.Int