[Tests] Add test for vararg callable reference adaption with typealias
#KT-65817 Fixed
This commit is contained in:
committed by
Space Team
parent
365973f03a
commit
9606a5a441
Vendored
+11
@@ -1,6 +1,10 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
fun foo(vararg ints: Int) {}
|
fun foo(vararg ints: Int) {}
|
||||||
|
|
||||||
|
typealias MyInt = Int
|
||||||
|
fun fooAlias(vararg ints: MyInt) {}
|
||||||
|
|
||||||
fun test(i: IntArray) {
|
fun test(i: IntArray) {
|
||||||
myLet(i, ::foo)
|
myLet(i, ::foo)
|
||||||
myLet(::foo)
|
myLet(::foo)
|
||||||
@@ -8,6 +12,13 @@ fun test(i: IntArray) {
|
|||||||
myLet<IntArray>(::foo)
|
myLet<IntArray>(::foo)
|
||||||
myLetExplicit1(::foo)
|
myLetExplicit1(::foo)
|
||||||
myLetExplicit2(::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) {}
|
fun <T> myLet(t: T, block: (T) -> Unit) {}
|
||||||
|
|||||||
Vendored
+11
@@ -1,6 +1,10 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
fun foo(vararg ints: Int) {}
|
fun foo(vararg ints: Int) {}
|
||||||
|
|
||||||
|
typealias MyInt = Int
|
||||||
|
fun fooAlias(vararg ints: MyInt) {}
|
||||||
|
|
||||||
fun test(i: IntArray) {
|
fun test(i: IntArray) {
|
||||||
myLet(i, ::foo)
|
myLet(i, ::foo)
|
||||||
myLet(::foo)
|
myLet(::foo)
|
||||||
@@ -8,6 +12,13 @@ fun test(i: IntArray) {
|
|||||||
myLet<IntArray>(::foo)
|
myLet<IntArray>(::foo)
|
||||||
myLetExplicit1(::foo)
|
myLetExplicit1(::foo)
|
||||||
myLetExplicit2(::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) {}
|
fun <T> myLet(t: T, block: (T) -> Unit) {}
|
||||||
|
|||||||
Vendored
+3
@@ -1,8 +1,11 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun foo(/*0*/ vararg ints: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
|
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*/ block: (T) -> kotlin.Unit): kotlin.Unit
|
||||||
public fun </*0*/ T> myLet(/*0*/ t: T, /*1*/ 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 myLetExplicit1(/*0*/ block: (kotlin.Int) -> kotlin.Unit): kotlin.Unit
|
||||||
public fun myLetExplicit2(/*0*/ block: (kotlin.IntArray) -> 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 fun test(/*0*/ i: kotlin.IntArray): kotlin.Unit
|
||||||
|
public typealias MyInt = kotlin.Int
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user