From b4c216483799744612debce6fc7be74295ba0938 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Tue, 5 Mar 2024 19:41:20 +0100 Subject: [PATCH] [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 --- .../kt42208WithPassingLambdaToAnotherFunction.kt | 6 +----- .../kt42208WithPassingLambdaToAnotherFunction.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.kt b/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.kt index 2d3ffcab6d0..547dd324224 100644 --- a/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.kt +++ b/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.kt @@ -1,9 +1,5 @@ // KIND: STANDALONE_LLDB -// FREE_COMPILER_ARGS: -XXLanguage:+UnitConversionsOnArbitraryExpressions -// IGNORE_BACKEND_K2: NATIVE // 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 fun main() { val a = foo() @@ -17,6 +13,6 @@ inline fun foo() = { -> list.add(A()) } // FILE: kt42208-3.kt -fun bar(v:(()->Unit)) { +fun bar(v:(()->Boolean)) { v() } diff --git a/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.txt b/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.txt index c515d7d2b0e..623dfabbbaa 100644 --- a/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.txt +++ b/native/native.tests/testData/lldb/kt42208WithPassingLambdaToAnotherFunction.txt @@ -1,13 +1,13 @@ -> b kt42208-2.kt:17 +> b kt42208-2.kt:13 > r > bt * thread #1, [..] stop reason = breakpoint 1.1 - * frame #0: [..]`kfun:[..]main$lambda$0[..] at kt42208-2.kt:17:5 - frame #1: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]invoke[..](_this=[..])[..] at kt42208-2.kt:16:20 - frame #2: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]$invoke(_this=[..]){}kotlin.Boolean[..] at kt42208-2.kt:16:20 + * 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:12:20 + frame #2: [..]`kfun:$main$lambda$0$FUNCTION_REFERENCE$0.[..]$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 #4: [..]`kfun:#bar(v=[..]){} at kt42208-3.kt:21:5 - frame #5: [..]`kfun:#main(){} at kt42208-1.kt:10:5 + frame #4: [..]`kfun:#bar(v=[..]){} at kt42208-3.kt:17:5 + frame #5: [..]`kfun:#main(){} at kt42208-1.kt:6:5 frame #6: [..]`Konan_start(args=[..]) at [..] > c > q