85 lines
2.5 KiB
Plaintext
Vendored
85 lines
2.5 KiB
Plaintext
Vendored
FILE: lambda.kt
|
|
public? final? data class Tuple : R|kotlin/Any| {
|
|
public? constructor(x: Int, y: Int): R|Tuple| {
|
|
super<R|kotlin/Any|>()
|
|
}
|
|
|
|
public? final? val x: Int = R|<local>/x|
|
|
public? get(): Int
|
|
|
|
public? final? val y: Int = R|<local>/y|
|
|
public? get(): Int
|
|
|
|
public final fun component1(): <implicit> {
|
|
^component1 this@R|/Tuple|.R|/Tuple.x|
|
|
}
|
|
|
|
public final fun component2(): <implicit> {
|
|
^component2 this@R|/Tuple|.R|/Tuple.y|
|
|
}
|
|
|
|
public final fun copy(x: Int = this@R|/Tuple|.R|/Tuple.x|, y: Int = this@R|/Tuple|.R|/Tuple.y|): R|Tuple| {
|
|
}
|
|
|
|
}
|
|
public? final? inline fun use(f: ( (Tuple) -> Int )): <implicit> {
|
|
^use f#(Tuple#(Int(1), Int(2)))
|
|
}
|
|
public? final? fun foo(): Int {
|
|
lval l1: <implicit> = fun <implicit>.<anonymous>(t: Tuple): <implicit> {
|
|
lval x: <implicit> = t#.x#
|
|
lval y: <implicit> = t#.y#
|
|
x#.plus#(y#)
|
|
}
|
|
|
|
use#(<L> = use@fun <implicit>.<anonymous>(<destruct>: <implicit>): <implicit> {
|
|
lval x: <implicit> = R|<local>/<destruct>|.component1()
|
|
lval y: <implicit> = R|<local>/<destruct>|.component2()
|
|
x#.plus#(y#)
|
|
}
|
|
)
|
|
^foo use#(<L> = use@fun <implicit>.<anonymous>(): <implicit> {
|
|
when () {
|
|
==(it#.x#, Int(0)) -> {
|
|
^foo Int(0)
|
|
}
|
|
}
|
|
|
|
^@use it#.y#
|
|
}
|
|
)
|
|
}
|
|
public? final? fun bar(): Int {
|
|
^bar use#(<L> = lambda@fun <implicit>.<anonymous>(): <implicit> {
|
|
when () {
|
|
==(it#.x#, Int(0)) -> {
|
|
^bar Int(0)
|
|
}
|
|
}
|
|
|
|
^@lambda it#.y#
|
|
}
|
|
)
|
|
}
|
|
public? final? fun test(list: List<Int>): R|kotlin/Unit| {
|
|
lval map: <implicit> = mutableMapOf#<Int, String>()
|
|
list#.forEach#(<L> = forEach@fun <implicit>.<anonymous>(): <implicit> {
|
|
lval <complex-set>: <implicit> = map#.getOrPut#(it#, getOrPut@fun <implicit>.<anonymous>(): <implicit> {
|
|
mutableListOf#()
|
|
}
|
|
)
|
|
<complex-set># += String()
|
|
}
|
|
)
|
|
}
|
|
public? final? val simple: <implicit> = fun <implicit>.<anonymous>(): <implicit> {
|
|
Unit
|
|
}
|
|
|
|
public? get(): <implicit>
|
|
public? final? val another: <implicit> = fun <implicit>.<anonymous>(): <implicit> {
|
|
Int(42)
|
|
}
|
|
|
|
public? get(): <implicit>
|