Extraction Engine: Fix extraction of labeled and non-local returns
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(a: Int): Int {
|
||||
a.let {
|
||||
<selection>if (it > 0) return it else return@foo -it</selection>
|
||||
}
|
||||
return 0
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(a: Int): Int {
|
||||
a.let {
|
||||
return i(it)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
private fun i(it: Int): Int {
|
||||
if (it > 0) return it else return -it
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(a: Int): Int {
|
||||
a.let {
|
||||
<selection>if (it > 0) return@foo it else return -it</selection>
|
||||
}
|
||||
return 0
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(a: Int): Int {
|
||||
a.let {
|
||||
return@foo i(it)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
private fun i(it: Int): Int {
|
||||
if (it > 0) return it else return -it
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(): Int {
|
||||
1.let { <selection>return it + 1</selection> }
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(): Int {
|
||||
1.let { return i(it) }
|
||||
}
|
||||
|
||||
private fun i(it: Int): Int {
|
||||
return it + 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(): Int {
|
||||
1.let { <selection>return@foo it + 1</selection> }
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Int defined in foo.<anonymous>
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
fun foo(): Int {
|
||||
1.let { return@foo i(it) }
|
||||
}
|
||||
|
||||
private fun i(it: Int): Int {
|
||||
return it + 1
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun foo(): Int {
|
||||
<selection>return@foo 1</selection>
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun foo(): Int {
|
||||
return@foo i()
|
||||
}
|
||||
|
||||
private fun i(): Int {
|
||||
return 1
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(a: Int): Int {
|
||||
a.let {
|
||||
<selection>if (it > 0) return@let it else return@foo -it</selection>
|
||||
}
|
||||
return 0
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Selected code fragment has multiple exit points
|
||||
Reference in New Issue
Block a user