[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>(<!TYPE_MISMATCH!>::fooAlias<!>)
myLet<IntArray>(::fooAlias)
myLetExplicit1(::fooAlias)
myLetExplicit2(::fooAlias)
}
fun <T> myLet(t: T, block: (T) -> Unit) {}