Skip to content

Commit 688802d

Browse files
committed
Check breakpoints work in delegate initializer
Additional test after review
1 parent e6ee933 commit 688802d

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
LineBreakpoint created at stopInInlineCallInFieldInDelegate.kt:11
2+
!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! stopInInlineCallInFieldInDelegate.StopInInlineCallInFieldInDelegateKt
3+
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
4+
stopInInlineCallInFieldInDelegate.kt:11
5+
stopInInlineCallInFieldInDelegate.kt:12
6+
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
7+
8+
Process finished with exit code 0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package stopInInlineCallInFieldInDelegate
2+
3+
import kotlin.reflect.KProperty
4+
5+
class A {
6+
var value = 42
7+
8+
val b: String by getDelegate {
9+
{
10+
//Breakpoint!
11+
foo(value)
12+
}()
13+
}
14+
}
15+
16+
@Suppress("NOTHING_TO_INLINE")
17+
inline fun getDelegate(function: () -> Unit): Delegate {
18+
function()
19+
return Delegate()
20+
}
21+
22+
class Delegate() {
23+
operator fun getValue(a: A, property: KProperty<*>): String = ""
24+
}
25+
26+
fun foo(a: Any) {}
27+
28+
fun main(args: Array<String>) {
29+
A().b
30+
}

idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,12 @@ public void testStopInInlineCallInFieldInClassWithNonDefaultPrimary() throws Exc
740740
doStepOverTest(fileName);
741741
}
742742

743+
@TestMetadata("stopInInlineCallInFieldInDelegate.kt")
744+
public void testStopInInlineCallInFieldInDelegate() throws Exception {
745+
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallInFieldInDelegate.kt");
746+
doStepOverTest(fileName);
747+
}
748+
743749
@TestMetadata("stopInInlineCallInFieldInLocalClass.kt")
744750
public void testStopInInlineCallInFieldInLocalClass() throws Exception {
745751
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallInFieldInLocalClass.kt");

0 commit comments

Comments
 (0)