New evaluator that doesn't depend on the 'extract function' refactoring (KT-28192, KT-25220, KT-25222, KT-21650)
This commit is contained in:
+6
@@ -30,19 +30,25 @@ clearCache.kt:42
|
||||
clearCache.kt:52
|
||||
Compile bytecode for o.test()
|
||||
clearCache.kt:60
|
||||
Compile bytecode for o.test()
|
||||
clearCache.kt:78
|
||||
Compile bytecode for c.size
|
||||
clearCache.kt:86
|
||||
Compile bytecode for c.size
|
||||
clearCache.kt:95
|
||||
Compile bytecode for c.size
|
||||
clearCache.kt:105
|
||||
Compile bytecode for c.size
|
||||
clearCache.kt:113
|
||||
Compile bytecode for c.size
|
||||
clearCache.kt:123
|
||||
Compile bytecode for o.test()
|
||||
clearCache.kt:131
|
||||
Compile bytecode for o.test()
|
||||
clearCache.kt:149
|
||||
Compile bytecode for obj.test()
|
||||
clearCache.kt:154
|
||||
Compile bytecode for obj.test()
|
||||
clearCache.kt:161
|
||||
Compile bytecode for o.test()
|
||||
clearCache.kt:169
|
||||
|
||||
+4
-4
@@ -37,15 +37,15 @@ fun genericClassCast() {
|
||||
val c = ArrayList<Int>()
|
||||
c.add(1)
|
||||
// EXPRESSION: c.get(0)
|
||||
// RESULT: 1: I
|
||||
// RESULT: instance of java.lang.Integer(id=ID): Ljava/lang/Integer;
|
||||
//Breakpoint!
|
||||
val b = 1
|
||||
}
|
||||
|
||||
if (true) {
|
||||
val c = ArrayList<String>()
|
||||
c.add("a")
|
||||
// EXPRESSION: c.get(0)
|
||||
val c = ArrayList<Int>()
|
||||
(c as? ArrayList<String>)?.add("a")
|
||||
// EXPRESSION: c.get(0) + 1
|
||||
// RESULT: java.lang.ClassCastException : java.lang.String cannot be cast to java.lang.Number
|
||||
//Breakpoint!
|
||||
val b = 1
|
||||
|
||||
+3
@@ -9,12 +9,15 @@ Connected to the target VM
|
||||
exceptions.kt:9
|
||||
Compile bytecode for fail()
|
||||
exceptions.kt:14
|
||||
Compile bytecode for fail()
|
||||
exceptions.kt:26
|
||||
Compile bytecode for o as Derived
|
||||
exceptions.kt:31
|
||||
Compile bytecode for o as Derived
|
||||
exceptions.kt:42
|
||||
Compile bytecode for c.get(0)
|
||||
exceptions.kt:51
|
||||
Compile bytecode for c.get(0) + 1
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
|
||||
Vendored
+2
@@ -41,9 +41,11 @@ Compile bytecode for extClass.testCompPrivate()
|
||||
extensionMemberFunction.kt:88
|
||||
Compile bytecode for testCompPrivate()
|
||||
extensionMemberFunction.kt:98
|
||||
Compile bytecode for testCompPublic()
|
||||
extensionMemberFunction.kt:103
|
||||
Compile bytecode for this.testCompPublic()
|
||||
extensionMemberFunction.kt:108
|
||||
Compile bytecode for testCompPrivate()
|
||||
extensionMemberFunction.kt:113
|
||||
Compile bytecode for this.testCompPrivate()
|
||||
Disconnected from the target VM
|
||||
|
||||
Vendored
+2
@@ -41,9 +41,11 @@ Compile bytecode for extClass.testCompPrivate
|
||||
extensionMemberProperty.kt:92
|
||||
Compile bytecode for testCompPrivate
|
||||
extensionMemberProperty.kt:102
|
||||
Compile bytecode for testCompPublic
|
||||
extensionMemberProperty.kt:107
|
||||
Compile bytecode for this.testCompPublic
|
||||
extensionMemberProperty.kt:112
|
||||
Compile bytecode for testCompPrivate
|
||||
extensionMemberProperty.kt:117
|
||||
Compile bytecode for this.testCompPrivate
|
||||
Disconnected from the target VM
|
||||
|
||||
+1
-1
@@ -24,4 +24,4 @@ fun main() {
|
||||
// RESULT: "field": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: field
|
||||
// RESULT: Can't find a backing field for property field
|
||||
// RESULT: Cannot find the backing field 'b'
|
||||
Vendored
+1
-1
@@ -23,7 +23,7 @@ class Outer {
|
||||
// outer isn't captured in lambda
|
||||
lambda {
|
||||
// EXPRESSION: foo() + 2
|
||||
// RESULT: java.lang.AssertionError : Cannot find local variable: name = 'this@Outer', type = funFromOuterClassInLamdba.Outer
|
||||
// RESULT: 'this@Outer' is not captured
|
||||
//Breakpoint!
|
||||
val a = 1
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ fun test1(derived: Base) =
|
||||
// RESULT: 1: I
|
||||
|
||||
// EXPRESSION: nullable.prop
|
||||
// RESULT: Method threw 'kotlin.TypeCastException' exception.
|
||||
// RESULT: java.lang.NullPointerException
|
||||
fun test2(nullable: Derived?) =
|
||||
nullable != null &&
|
||||
//Breakpoint!
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ fun main() {
|
||||
//Breakpoint!
|
||||
block(3) c@ {
|
||||
//Breakpoint!
|
||||
val a = 5
|
||||
val a = this@a + this@b + this@c
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,4 @@ fun <T> T.inlineBlock(t: T, block: T.() -> Unit) {
|
||||
// RESULT: 2: I
|
||||
|
||||
// EXPRESSION: this + this@a + this@b + this@c
|
||||
// RESULT: 12: I
|
||||
// RESULT: 9: I
|
||||
+1
-3
@@ -4,12 +4,10 @@ fun main(args: Array<String>) {
|
||||
val callable = 1
|
||||
arrayOf(1, 2).map {
|
||||
it + 1
|
||||
//Breakpoint!
|
||||
//Breakpoint! (lambdaOrdinal = 1)
|
||||
}.forEach { it + 2 }
|
||||
}
|
||||
|
||||
// STEP_INTO: 1
|
||||
|
||||
// EXPRESSION: callable
|
||||
// RESULT: 1: I
|
||||
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
LineBreakpoint created at callableBug.kt:8
|
||||
LineBreakpoint created at callableBug.kt:8 lambdaOrdinal = 1
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
callableBug.kt:8
|
||||
callableBug.kt:8
|
||||
Compile bytecode for callable
|
||||
Compile bytecode for it
|
||||
callableBug.kt:8
|
||||
|
||||
Vendored
+1
-1
@@ -16,4 +16,4 @@ interface T {
|
||||
// RESULT: 1: I
|
||||
|
||||
// EXPRESSION: object: T {}
|
||||
// RESULT: instance of ceObject.Generated_for_debugger_class$generated_for_debugger_fun$1(id=ID): LceObject/Generated_for_debugger_class$generated_for_debugger_fun$1;
|
||||
// RESULT: instance of Generated_for_debugger_class$generated_for_debugger_fun$1(id=ID): LGenerated_for_debugger_class$generated_for_debugger_fun$1;
|
||||
@@ -28,4 +28,4 @@ open class Base {
|
||||
// RESULT: Expecting an element; looking at ERROR_ELEMENT '(1,6) in /fragment.kt
|
||||
|
||||
// EXPRESSION: super.baseFun()
|
||||
// RESULT: Cannot perform an action for expression with super call
|
||||
// RESULT: Evaluation of 'super' call expression is not supported
|
||||
+1
-1
@@ -2,4 +2,4 @@ prop += 1
|
||||
prop2 +=2
|
||||
prop + prop2
|
||||
|
||||
// RESULT: instance of kotlin.Triple(id=ID): Lkotlin/Triple;
|
||||
// RESULT: 6: I
|
||||
@@ -6,7 +6,7 @@ Compile bytecode for prop += 1
|
||||
prop2 +=2
|
||||
prop + prop2
|
||||
|
||||
// RESULT: instance of kotlin.Triple(id=ID): Lkotlin/Triple;
|
||||
// RESULT: 6: I
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
|
||||
+8
-15
@@ -4,22 +4,15 @@ Connected to the target VM
|
||||
suspendContinuation.kt:7
|
||||
Compile bytecode for a
|
||||
frame = main:7, SuspendContinuationKt {suspendContinuation}
|
||||
local = $continuation: kotlin.coroutines.Continuation = {suspendContinuation.SuspendContinuationKt$main$1@uniqueID}Continuation at suspendContinuation.SuspendContinuationKt.main(suspendContinuation.kt:5) (sp = null)
|
||||
field = result: java.lang.Object = null (sp = null)
|
||||
local = $completion: kotlin.coroutines.Continuation = {kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1@uniqueID}Continuation at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1 (sp = null)
|
||||
field = label: int = 1 (sp = null)
|
||||
field = I$0: int = 5 (sp = null)
|
||||
field = intercepted: kotlin.coroutines.Continuation = null (sp = ContinuationImpl.!EXT!)
|
||||
field = _context: kotlin.coroutines.CoroutineContext = {kotlin.coroutines.EmptyCoroutineContext@uniqueID}EmptyCoroutineContext (sp = ContinuationImpl.!EXT!)
|
||||
- No fields to display
|
||||
field = completion: kotlin.coroutines.Continuation = {kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1@uniqueID}Continuation at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1 (sp = BaseContinuationImpl.!EXT!)
|
||||
field = label: int = 1 (sp = null)
|
||||
field = $completion: kotlin.coroutines.Continuation = {kotlin.coroutines.jvm.internal.RunSuspend@uniqueID} (sp = null)
|
||||
field = result: kotlin.Result = null (sp = RunSuspend.!EXT!)
|
||||
field = $this_createCoroutineUnintercepted$inlined: kotlin.jvm.functions.Function1 = {suspendContinuation.SuspendContinuationKt$$$main@uniqueID}interface kotlin.jvm.functions.Function1 (sp = null)
|
||||
field = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = null)
|
||||
field = arity: int = 1 (sp = Lambda.!EXT!)
|
||||
field = completion: kotlin.coroutines.Continuation = {kotlin.coroutines.jvm.internal.RunSuspend@uniqueID} (sp = BaseContinuationImpl.!EXT!)
|
||||
field = result: kotlin.Result = null (sp = RunSuspend.!EXT!)
|
||||
field = $completion: kotlin.coroutines.Continuation = {kotlin.coroutines.jvm.internal.RunSuspend@uniqueID} (sp = null)
|
||||
field = result: kotlin.Result = null (sp = RunSuspend.!EXT!)
|
||||
field = $this_createCoroutineUnintercepted$inlined: kotlin.jvm.functions.Function1 = {suspendContinuation.SuspendContinuationKt$$$main@uniqueID}interface kotlin.jvm.functions.Function1 (sp = null)
|
||||
field = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = null)
|
||||
field = arity: int = 1 (sp = Lambda.!EXT!)
|
||||
field = completion: kotlin.coroutines.Continuation = {kotlin.coroutines.jvm.internal.RunSuspend@uniqueID} (sp = BaseContinuationImpl.!EXT!)
|
||||
field = result: kotlin.Result = null (sp = RunSuspend.!EXT!)
|
||||
local = a: int = 5 (sp = suspendContinuation.kt, 4)
|
||||
Disconnected from the target VM
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package kt25220
|
||||
|
||||
fun main() {
|
||||
//Breakpoint!
|
||||
val a = 5
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
val a = "a"
|
||||
val b = when (a) {
|
||||
"a" -> "A"
|
||||
"b" -> "B"
|
||||
else -> throw RuntimeException()
|
||||
}
|
||||
b
|
||||
|
||||
// RESULT: "A": Ljava/lang/String;
|
||||
@@ -0,0 +1,16 @@
|
||||
LineBreakpoint created at kt25220.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
kt25220.kt:5
|
||||
Compile bytecode for val a = "a"
|
||||
val b = when (a) {
|
||||
"a" -> "A"
|
||||
"b" -> "B"
|
||||
else -> throw RuntimeException()
|
||||
}
|
||||
b
|
||||
|
||||
// RESULT: "A": Ljava/lang/String;
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
@@ -0,0 +1,20 @@
|
||||
package kt25222
|
||||
|
||||
annotation class HelloWorld
|
||||
|
||||
class Foo {
|
||||
@HelloWorld
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val clazz = Class.forName("kt25222.Foo")
|
||||
val bar = clazz.declaredMethods.first { it.name == "bar" }
|
||||
val ann = bar.annotations.first()
|
||||
|
||||
//Breakpoint!
|
||||
val a = 5
|
||||
}
|
||||
|
||||
// EXPRESSION: ann
|
||||
// RESULT: instance of com.sun.proxy.$Proxy1(id=ID): Lcom/sun/proxy/$Proxy1;
|
||||
@@ -0,0 +1,8 @@
|
||||
LineBreakpoint created at kt25222.kt:16
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
kt25222.kt:16
|
||||
Compile bytecode for ann
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+15
-1
@@ -3,7 +3,7 @@ package nestedInlineArguments
|
||||
fun main(args: Array<String>) {
|
||||
val list1 = listOf("a")
|
||||
val list2 = listOf(Bar())
|
||||
list1.map { list2.foo(1) }
|
||||
list1.mapTest { list2.foo(1) }
|
||||
}
|
||||
|
||||
inline fun <reified T: Bar> List<T>.foo(key: Int): T? {
|
||||
@@ -16,4 +16,18 @@ inline fun <reified T: Bar> List<T>.foo(key: Int): T? {
|
||||
open class Foo
|
||||
open class Bar {
|
||||
val i = 1
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
inline fun <T, R> Iterable<T>.mapTest(transform: (T) -> R): List<R> {
|
||||
return mapToTest(ArrayList<R>(), transform)
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.mapToTest(destination: C, transform: (T) -> R): C {
|
||||
for (item in this)
|
||||
destination.add(transform(item))
|
||||
return destination
|
||||
}
|
||||
+1
-1
@@ -15,4 +15,4 @@ class Some {
|
||||
|
||||
}
|
||||
// EXPRESSION: base.a
|
||||
// RESULT: java.lang.NoSuchMethodError : Method not found: MemberDescription(ownerInternalName = privatePropertyWithExplicitDefaultGetter/Some, name = getA, desc = ()I, isStatic = false)
|
||||
// RESULT: 1: I
|
||||
|
||||
Reference in New Issue
Block a user