diff --git a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/smartStepInto/SmartStepTargetVisitor.kt b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/smartStepInto/SmartStepTargetVisitor.kt index 53d234e07ca..819b48ccb39 100644 --- a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/smartStepInto/SmartStepTargetVisitor.kt +++ b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/smartStepInto/SmartStepTargetVisitor.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde +import org.jetbrains.kotlin.idea.debugger.breakpoints.isInlineOnly import org.jetbrains.kotlin.idea.project.platform import org.jetbrains.kotlin.idea.util.application.runReadAction import org.jetbrains.kotlin.load.java.isFromJava @@ -185,6 +186,11 @@ class SmartStepTargetVisitor( } } + // We can't step into @InlineOnly callables as there is no LVT, so skip them + if (declaration is KtCallableDeclaration && declaration.isInlineOnly()) { + return + } + val callLabel = KotlinMethodSmartStepTarget.calcLabel(descriptor) val label = when (descriptor) { is FunctionInvokeDescriptor -> { diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java index 21a9ab4068b..ad859574db0 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java @@ -103,6 +103,11 @@ public class SmartStepIntoTestGenerated extends AbstractSmartStepIntoTest { runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/infixCall.kt"); } + @TestMetadata("inlineOnly.kt") + public void testInlineOnly() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlineOnly.kt"); + } + @TestMetadata("inlinedFunLiteral.kt") public void testInlinedFunLiteral() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlinedFunLiteral.kt"); diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/constructor.kt b/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/constructor.kt index 55c6ae92cb9..4706e8a3730 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/constructor.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/constructor.kt @@ -41,4 +41,4 @@ class L { } } -// EXISTS: println(Any?), constructor B(), constructor C(Int), constructor D(), constructor E(Int), constructor F(), constructor G(Int), constructor J(), constructor K(Int), constructor L() \ No newline at end of file +// EXISTS: constructor B(), constructor C(Int), constructor D(), constructor E(Int), constructor F(), constructor G(Int), constructor J(), constructor K(Int), constructor L() \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlineOnly.kt b/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlineOnly.kt new file mode 100644 index 00000000000..8705dd13772 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlineOnly.kt @@ -0,0 +1,7 @@ +fun foo() { + val a = mutableListOf("A", "B").also { it.add("C") } + val b = a +} + +// EXISTS: mutableListOf(vararg String) +// EXISTS: also: block.invoke() \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/libraryFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/libraryFun.kt index 501c40cb15a..02e2d287725 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/libraryFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/libraryFun.kt @@ -2,4 +2,6 @@ fun foo() { arrayListOf(1, 2).count() } +fun List.count(): Int = size + // EXISTS: arrayListOf(vararg Int), count() \ No newline at end of file