Pseudocode: Bind nondeterministic jump caused by local declaration to declaration iself instead of its parent element

#KT-6261 Fixed
 #KT-6416 Fixed
This commit is contained in:
Alexey Sedunov
2015-01-12 14:15:34 +03:00
parent 81715d1fca
commit 9278dee1a4
13 changed files with 145 additions and 4 deletions
@@ -0,0 +1,6 @@
fun test1(): Int {
<selection>val foo = 1
fun bar() = 2
return 3</selection>
}
@@ -0,0 +1,10 @@
fun test1(): Int {
return i()
}
private fun i(): Int {
val foo = 1
fun bar() = 2
return 3
}
@@ -0,0 +1,5 @@
fun test(): Int {
<selection>val j = 1
fun local() = 1
return local()</selection>
}
@@ -0,0 +1,9 @@
fun test(): Int {
return i()
}
private fun i(): Int {
val j = 1
fun local() = 1
return local()
}
@@ -0,0 +1,9 @@
fun test(): Int {
<selection>val foo = 1
fun bar() = 2
return when (foo) {
1 -> 1
else -> 2
}</selection>
}
@@ -0,0 +1,13 @@
fun test(): Int {
return i()
}
private fun i(): Int {
val foo = 1
fun bar() = 2
return when (foo) {
1 -> 1
else -> 2
}
}