Evaluate expression: support inline functions from source code

This commit is contained in:
Natalia Ukhorskaya
2015-04-20 15:52:09 +03:00
parent 9f2955c434
commit 74e68950f9
5 changed files with 74 additions and 12 deletions
@@ -0,0 +1,8 @@
LineBreakpoint created at inlineFunction.kt:7
!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! inlineFunction.InlineFunctionPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
inlineFunction.kt:7
Compile bytecode for myFun { 1 }
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,11 @@
package inlineFunction
import inlineFunctionOtherPackage.*
fun main(args: Array<String>) {
//Breakpoint!
val a = 1
}
// EXPRESSION: myFun { 1 }
// RESULT: 1: I
@@ -0,0 +1,3 @@
package inlineFunctionOtherPackage
inline fun myFun(f: () -> Int): Int = f()