Fix step over for inlined functions in Android Studio (KT-14374)
#KT-14374 Fixed
This commit is contained in:
@@ -3,10 +3,10 @@ package inlineInIfTrueDex
|
||||
fun main(args: Array<String>) {
|
||||
val bar = ""
|
||||
//Breakpoint!
|
||||
if (inlineCall { true }) {
|
||||
foo()
|
||||
if (inlineCall { true }) { // 1
|
||||
foo() // 2
|
||||
}
|
||||
}
|
||||
} // 3
|
||||
|
||||
fun foo() {}
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -2,14 +2,14 @@ package soInlineAnonymousFunctionArgumentDex
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
//Breakpoint!
|
||||
val b = 1
|
||||
val b = 1 // 1
|
||||
|
||||
foo(
|
||||
fun (){ test(1) }
|
||||
foo( // 2
|
||||
fun (){ test(1) } //
|
||||
)
|
||||
|
||||
foo(fun (){ test(1) })
|
||||
}
|
||||
foo(fun (){ test(1) }) // 3
|
||||
} // 4
|
||||
|
||||
inline fun foo(f: () -> Unit) {
|
||||
f()
|
||||
|
||||
Vendored
+4
-4
@@ -2,13 +2,13 @@ package soInlineCallInLastStatementInInlineDex
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
bar()
|
||||
nop()
|
||||
}
|
||||
nop() // 3
|
||||
} // 4
|
||||
|
||||
inline fun bar() {
|
||||
//Breakpoint!
|
||||
nop()
|
||||
foo { 42 }
|
||||
nop() // 1
|
||||
foo { 42 } // 2
|
||||
}
|
||||
|
||||
inline fun foo(f: () -> Unit) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package soInlineFunDex
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = 1
|
||||
|
||||
//Breakpoint!
|
||||
simple() // 1
|
||||
|
||||
withParam(1 + a) // 2
|
||||
|
||||
withLambda { "hi" } // 3
|
||||
} // 4
|
||||
|
||||
inline fun simple() {
|
||||
foo()
|
||||
}
|
||||
|
||||
inline fun withParam(i: Int) {
|
||||
}
|
||||
|
||||
inline fun withLambda(a: () -> Unit) {
|
||||
a()
|
||||
}
|
||||
|
||||
fun foo() {}
|
||||
|
||||
// STEP_OVER: 6
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package soInlineFunOnOneLineFor
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val list = listOf(1, 2, 3)
|
||||
|
||||
list.any1 { it > 2 }
|
||||
|
||||
foo()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
inline fun <T> Iterable<T>.any1(predicate: (T) -> Boolean): Boolean {
|
||||
//Breakpoint!
|
||||
for (element in this) if (predicate(element)) return true
|
||||
return false
|
||||
}
|
||||
|
||||
// STEP_OVER: 3
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package soInlineFunOnOneLineForDex
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val list = listOf(1, 2, 3)
|
||||
|
||||
list.any1 { it > 2 }
|
||||
|
||||
foo()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
inline fun <T> Iterable<T>.any1(predicate: (T) -> Boolean): Boolean {
|
||||
//Breakpoint!
|
||||
for (element in this) if (predicate(element)) return true
|
||||
return false
|
||||
}
|
||||
|
||||
// STEP_OVER: 3
|
||||
@@ -0,0 +1,22 @@
|
||||
package soInlineFunWithFor
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
//Breakpoint!
|
||||
foo()
|
||||
|
||||
val r = any1 { it > 2 }
|
||||
|
||||
foo()
|
||||
}
|
||||
|
||||
fun foo() {}
|
||||
|
||||
inline fun any1(predicate: (Int) -> Boolean) {
|
||||
for (i in 1..2) {
|
||||
if (predicate(i)) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// STEP_OVER: 5
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package soInlineIterableFunDex
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
//Breakpoint!
|
||||
val list = listOf(1, 2, 3)
|
||||
|
||||
list.any1 { it > 2 }
|
||||
|
||||
foo()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
inline fun <T> Iterable<T>.any1(predicate: (T) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
return false
|
||||
}
|
||||
|
||||
// STEP_OVER: 5
|
||||
@@ -0,0 +1,18 @@
|
||||
package soInlineLibFunDex
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
//Breakpoint!
|
||||
var i = 1
|
||||
|
||||
listOf(1, 2, 3).any { it > 2 } // Step over goes into 'any' (regression)
|
||||
|
||||
if (listOf(1, 2, 3).any { it > 2 }) { // Step over goes into 'any'
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
inline fun test(a: () -> Unit) {
|
||||
a()
|
||||
}
|
||||
|
||||
// STEP_OVER: 7
|
||||
+1
-1
@@ -9,7 +9,7 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
|
||||
// inline in while condition (false)
|
||||
while (id { false }) { // 5
|
||||
while (id { false }) { // 5
|
||||
bar()
|
||||
}
|
||||
} // 6
|
||||
|
||||
Reference in New Issue
Block a user