Evaluate Expression: support local functions
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package customLib.localFunInLibraryCustomLib
|
||||
|
||||
public fun localFunInLibraryCustomLibMainFun() {
|
||||
fun localFun() = 1
|
||||
val localFunInLibraryCustomLibProperty = 1
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
LineBreakpoint created at localFun.kt:9
|
||||
LineBreakpoint created at localFun.kt:15
|
||||
LineBreakpoint created at localFun.kt:21
|
||||
LineBreakpoint created at localFun.kt:34
|
||||
LineBreakpoint created at localFun.kt:43
|
||||
LineBreakpoint created at localFun.kt:54
|
||||
LineBreakpoint created at localFun.kt:61
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! localFun.LocalFunPackage
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
localFun.kt:9
|
||||
Compile bytecode for myLocalFun1()
|
||||
localFun.kt:15
|
||||
Compile bytecode for myLocalFun2()
|
||||
localFun.kt:21
|
||||
Compile bytecode for myLocalFun1() + 1
|
||||
localFun.kt:34
|
||||
Compile bytecode for myLocalFun4()
|
||||
localFun.kt:43
|
||||
Compile bytecode for myLocalFun5(2)
|
||||
localFun.kt:54
|
||||
Compile bytecode for myLocalFun6()
|
||||
localFun.kt:61
|
||||
Compile bytecode for myLocalFun6() + 1
|
||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
|
||||
Process finished with exit code 0
|
||||
@@ -0,0 +1,8 @@
|
||||
LineBreakpoint created at localFunCustomLib.kt:5
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! localFunInLibrary.LocalFunInLibraryPackage
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
localFunCustomLib.kt:6
|
||||
Compile bytecode for localFun()
|
||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
|
||||
Process finished with exit code 0
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package localFunInLibrary
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
customLib.localFunInLibraryCustomLib.localFunInLibraryCustomLibMainFun()
|
||||
}
|
||||
|
||||
// ADDITIONAL_BREAKPOINT: localFunCustomLib.kt:localFunInLibraryCustomLibProperty
|
||||
// EXPRESSION: localFun()
|
||||
// RESULT: 1: I
|
||||
@@ -0,0 +1,65 @@
|
||||
package localFun
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
fun myLocalFun1() = 1
|
||||
|
||||
// EXPRESSION: myLocalFun1()
|
||||
// RESULT: 1: I
|
||||
//Breakpoint!
|
||||
myLocalFun1()
|
||||
|
||||
fun myLocalFun2() = 2
|
||||
// EXPRESSION: myLocalFun2()
|
||||
// RESULT: 2: I
|
||||
//Breakpoint!
|
||||
myLocalFun2()
|
||||
|
||||
fun myLocalFun3() {
|
||||
// EXPRESSION: myLocalFun1() + 1
|
||||
// RESULT: Cannot find local variable: name = myLocalFun1
|
||||
//Breakpoint!
|
||||
myLocalFun1() + 1
|
||||
}
|
||||
|
||||
myLocalFun3()
|
||||
|
||||
|
||||
fun myLocalFun4(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// EXPRESSION: myLocalFun4()
|
||||
// RESULT: 1: I
|
||||
//Breakpoint!
|
||||
myLocalFun4()
|
||||
|
||||
fun myLocalFun5(i: Int): Int {
|
||||
return i
|
||||
}
|
||||
|
||||
// EXPRESSION: myLocalFun5(2)
|
||||
// RESULT: 2: I
|
||||
//Breakpoint!
|
||||
myLocalFun5(2)
|
||||
|
||||
var i = 1
|
||||
fun myLocalFun6(): Int {
|
||||
i++
|
||||
return i
|
||||
}
|
||||
|
||||
// EXPRESSION: myLocalFun6()
|
||||
// RESULT: 2: I
|
||||
//Breakpoint!
|
||||
myLocalFun6()
|
||||
|
||||
i = 1
|
||||
fun myLocalFun7() {
|
||||
// EXPRESSION: myLocalFun6() + 1
|
||||
// RESULT: 3: I
|
||||
//Breakpoint!
|
||||
myLocalFun6() + 1
|
||||
}
|
||||
|
||||
myLocalFun7()
|
||||
}
|
||||
Reference in New Issue
Block a user