[K/N][tests] Fix kt42208WithPassingLambdaToAnotherFunction.kt for K2

It seems that K2 doesn't support `UnitConversionsOnArbitraryExpressions`
experimental language feature (KT-56011), while the test accidentally
relied on it.

Improve the test code so that it doesn't need this language feature
anymore, and enable the test for K2.

^KT-65553 Fixed
This commit is contained in:
Svyatoslav Scherbina
2024-03-05 19:41:20 +01:00
committed by Space Team
parent b7129f78a3
commit b4c2164837
2 changed files with 7 additions and 11 deletions
@@ -1,9 +1,5 @@
// KIND: STANDALONE_LLDB // KIND: STANDALONE_LLDB
// FREE_COMPILER_ARGS: -XXLanguage:+UnitConversionsOnArbitraryExpressions
// IGNORE_BACKEND_K2: NATIVE
// FIR_IDENTICAL // FIR_IDENTICAL
// Not really `FIR_IDENTICAL`, because we ignore thois test for FIR, but with this directive presented we don't need to create separate `fir.txt` file for dump.
// FILE: kt42208-1.kt // FILE: kt42208-1.kt
fun main() { fun main() {
val a = foo() val a = foo()
@@ -17,6 +13,6 @@ inline fun foo() = { ->
list.add(A()) list.add(A())
} }
// FILE: kt42208-3.kt // FILE: kt42208-3.kt
fun bar(v:(()->Unit)) { fun bar(v:(()->Boolean)) {
v() v()
} }
@@ -1,13 +1,13 @@
> b kt42208-2.kt:17 > b kt42208-2.kt:13
> r > r
> bt > bt
* thread #1, [..] stop reason = breakpoint 1.1 * thread #1, [..] stop reason = breakpoint 1.1
* frame #0: [..]`kfun:[..]main$lambda$0[..] at kt42208-2.kt:17:5 * frame #0: [..]`kfun:[..]main$lambda$0[..] at kt42208-2.kt:13:5
frame #1: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]invoke[..](_this=[..])[..] at kt42208-2.kt:16:20 frame #1: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]invoke[..](_this=[..])[..] at kt42208-2.kt:12:20
frame #2: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]$<bridge-BNN>invoke(_this=[..]){}kotlin.Boolean[..] at kt42208-2.kt:16:20 frame #2: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]$<bridge-BNN>invoke(_this=[..]){}kotlin.Boolean[..] at kt42208-2.kt:12:20
frame #3: [..]`kfun:kotlin.Function0#invoke(){}1:0-trampoline at [K][Suspend]Functions:1:1 frame #3: [..]`kfun:kotlin.Function0#invoke(){}1:0-trampoline at [K][Suspend]Functions:1:1
frame #4: [..]`kfun:#bar(v=[..]){} at kt42208-3.kt:21:5 frame #4: [..]`kfun:#bar(v=[..]){} at kt42208-3.kt:17:5
frame #5: [..]`kfun:#main(){} at kt42208-1.kt:10:5 frame #5: [..]`kfun:#main(){} at kt42208-1.kt:6:5
frame #6: [..]`Konan_start(args=[..]) at [..] frame #6: [..]`Konan_start(args=[..]) at [..]
> c > c
> q > q