Evaluate Expression: fix for anonymous objects - expressions where anonymous type can be replaced with super type can be evaluated

This commit is contained in:
Natalia Ukhorskaya
2014-12-02 15:28:19 +03:00
parent b056fd7e2e
commit 3ab7c6c8e9
4 changed files with 55 additions and 0 deletions
@@ -0,0 +1,9 @@
LineBreakpoint created at anonymousObjects.kt:11
!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! anonymousObjects.AnonymousObjectsPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
anonymousObjects.kt:11
Compile bytecode for test(2)
Compile bytecode for i
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,19 @@
package anonymousObjects
fun main(args: Array<String>) {
val a = object: AbstractClass(1) {}
a.test(1)
}
abstract class AbstractClass(val i: Int) {
fun test(i: Int): Int {
//Breakpoint!
return i
}
}
// EXPRESSION: test(2)
// RESULT: 2: I
// EXPRESSION: i
// RESULT: 1: I