Pseudocode: Fix type predicate inference for values used inside of lambda
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: var b: kotlin.Int defined in foo
|
||||
// SIBLING:
|
||||
fun foo(a: Int): Int {
|
||||
var b: Int = 1
|
||||
|
||||
val t = <selection> { b += a; b }() </selection>
|
||||
println(b)
|
||||
|
||||
return t
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: var b: kotlin.Int defined in foo
|
||||
// SIBLING:
|
||||
fun foo(a: Int): Int {
|
||||
var b: Int = 1
|
||||
|
||||
val pair = pair(a, b)
|
||||
b = pair.second
|
||||
val t = pair.first
|
||||
println(b)
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
private fun pair(a: Int, b: Int): Pair<Int, Int> {
|
||||
var b1 = b
|
||||
return Pair({ b1 += a; b1 }(), b1)
|
||||
}
|
||||
Reference in New Issue
Block a user