diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TailCallOptimizationLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TailCallOptimizationLowering.kt index b71915e08e5..8512380fe71 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TailCallOptimizationLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TailCallOptimizationLowering.kt @@ -39,7 +39,7 @@ private class TailCallOptimizationLowering(private val context: JvmBackendContex override fun visitCall(expression: IrCall, data: TailCallOptimizationData?): IrExpression { val transformed = super.visitCall(expression, data) as IrExpression return if (data == null || expression !in data.tailCalls) transformed else IrReturnImpl( - expression.startOffset, expression.endOffset, context.irBuiltIns.nothingType, data.function.symbol, + data.function.endOffset, data.function.endOffset, context.irBuiltIns.nothingType, data.function.symbol, if (data.returnsUnit) transformed.coerceToUnit() else transformed ) } diff --git a/compiler/testData/debug/stepping/suspendFunWithLambdaParameter.kt b/compiler/testData/debug/stepping/suspendFunWithLambdaParameter.kt new file mode 100644 index 00000000000..2bad5f79a4c --- /dev/null +++ b/compiler/testData/debug/stepping/suspendFunWithLambdaParameter.kt @@ -0,0 +1,19 @@ +// WITH_COROUTINES +// FILE: test.kt +suspend fun foo(block: Long.() -> String): String { + return 1L.block() +} + +suspend fun box() { + foo { + "OK" + } +} + +// LINENUMBERS +// test.kt:8 box +// test.kt:4 foo +// test.kt:9 invoke +// test.kt:4 foo +// test.kt:8 box +// test.kt:11 box diff --git a/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt b/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt new file mode 100644 index 00000000000..e0cd02adac2 --- /dev/null +++ b/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt @@ -0,0 +1,25 @@ +// WITH_COROUTINES +// FILE: test.kt +suspend fun foo(block: suspend Long.() -> String): String { + return 1L.block() +} + +suspend fun box() { + foo { + "OK" + } +} + +// LINENUMBERS +// test.kt:8 box +// test.kt:4 foo +// CoroutineUtil.kt:28 getContext +// test.kt:-1 +// test.kt:-1 create +// test.kt:-1 invoke +// test.kt:8 invokeSuspend +// test.kt:9 invokeSuspend +// test.kt:-1 invoke +// test.kt:4 foo +// test.kt:8 box +// test.kt:11 box \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/IrSteppingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/IrSteppingTestGenerated.java index 8960d684f4a..86f69ce6205 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/IrSteppingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/IrSteppingTestGenerated.java @@ -379,6 +379,18 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest { runTest("compiler/testData/debug/stepping/stringSwitchesSmall.kt"); } + @Test + @TestMetadata("suspendFunWithLambdaParameter.kt") + public void testSuspendFunWithLambdaParameter() throws Exception { + runTest("compiler/testData/debug/stepping/suspendFunWithLambdaParameter.kt"); + } + + @Test + @TestMetadata("suspendFunWithSuspendLambdaParameter.kt") + public void testSuspendFunWithSuspendLambdaParameter() throws Exception { + runTest("compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt"); + } + @Test @TestMetadata("throwException.kt") public void testThrowException() throws Exception { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/SteppingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/SteppingTestGenerated.java index 15ce7f88602..6fde0447a82 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/SteppingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/debugInformation/SteppingTestGenerated.java @@ -379,6 +379,18 @@ public class SteppingTestGenerated extends AbstractSteppingTest { runTest("compiler/testData/debug/stepping/stringSwitchesSmall.kt"); } + @Test + @TestMetadata("suspendFunWithLambdaParameter.kt") + public void testSuspendFunWithLambdaParameter() throws Exception { + runTest("compiler/testData/debug/stepping/suspendFunWithLambdaParameter.kt"); + } + + @Test + @TestMetadata("suspendFunWithSuspendLambdaParameter.kt") + public void testSuspendFunWithSuspendLambdaParameter() throws Exception { + runTest("compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt"); + } + @Test @TestMetadata("throwException.kt") public void testThrowException() throws Exception {