Debugger: fix breakpoints inside generic crossinline argument body
#KT-11848 Fixed
This commit is contained in:
@@ -490,7 +490,7 @@ class KotlinPositionManager(private val myDebugProcess: DebugProcess) : MultiReq
|
|||||||
|
|
||||||
private fun findCrossInlineArguments(argument: KtFunction, parameterDescriptor: ValueParameterDescriptor, context: BindingContext): Set<String> {
|
private fun findCrossInlineArguments(argument: KtFunction, parameterDescriptor: ValueParameterDescriptor, context: BindingContext): Set<String> {
|
||||||
return runReadAction {
|
return runReadAction {
|
||||||
val source = parameterDescriptor.source.getPsi() as? KtParameter
|
val source = parameterDescriptor.original.source.getPsi() as? KtParameter
|
||||||
val functionName = source?.ownerFunction?.name
|
val functionName = source?.ownerFunction?.name
|
||||||
if (functionName != null) {
|
if (functionName != null) {
|
||||||
return@runReadAction setOf(getCrossInlineArgumentClassName(argument, functionName, context))
|
return@runReadAction setOf(getCrossInlineArgumentClassName(argument, functionName, context))
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
LineBreakpoint created at genericCrossinlineArgument.kt:14
|
||||||
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! genericCrossinlineArgument.GenericCrossinlineArgumentKt
|
||||||
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
genericCrossinlineArgument.kt:14
|
||||||
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package genericCrossinlineArgument
|
||||||
|
|
||||||
|
interface A {
|
||||||
|
fun expr(): Boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <T> test1(t: T, crossinline formula: T.() -> Boolean) = object : A {
|
||||||
|
override fun expr() = formula(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
test1("aaa") {
|
||||||
|
//Breakpoint!
|
||||||
|
1 + 1 > 0
|
||||||
|
}.expr()
|
||||||
|
}
|
||||||
+6
@@ -157,6 +157,12 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
|
|||||||
doSingleBreakpointTest(fileName);
|
doSingleBreakpointTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("genericCrossinlineArgument.kt")
|
||||||
|
public void testGenericCrossinlineArgument() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/genericCrossinlineArgument.kt");
|
||||||
|
doSingleBreakpointTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("imports.kt")
|
@TestMetadata("imports.kt")
|
||||||
public void testImports() throws Exception {
|
public void testImports() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/imports.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/imports.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user