mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 15:53:49 +00:00
22 lines
483 B
Plaintext
Vendored
22 lines
483 B
Plaintext
Vendored
// SUGGESTED_NAMES: pair, getT
|
|
// WITH_RUNTIME
|
|
// PARAM_TYPES: kotlin.Int
|
|
// PARAM_TYPES: kotlin.Int
|
|
// PARAM_DESCRIPTOR: var b: kotlin.Int defined in foo
|
|
// PARAM_DESCRIPTOR: value-parameter a: kotlin.Int defined in foo
|
|
// SIBLING:
|
|
fun foo(a: Int): Int {
|
|
var b: Int = 1
|
|
|
|
val pair = pair(b, a)
|
|
b = pair.second
|
|
val t = pair.first
|
|
println(b)
|
|
|
|
return t
|
|
}
|
|
|
|
private fun pair(b: Int, a: Int): Pair<Int, Int> {
|
|
var b1 = b
|
|
return Pair({ b1 += a; b1 }(), b1)
|
|
} |