[IR] Normalize temp var names in Kotlin-like dump

^KT-61983 Fixed
This commit is contained in:
Vladimir Sukharev
2023-09-19 21:29:17 +02:00
committed by Space Team
parent 6c519488a6
commit bae8b283c7
199 changed files with 1599 additions and 2273 deletions
@@ -750,12 +750,12 @@ private val IrFunction.safeReturnType: IrType?
private fun IrLocalDelegatedProperty.renderLocalDelegatedPropertyFlags() =
if (isVar) "var" else "val"
private class VariableNameData(val normalizeNames: Boolean) {
internal class VariableNameData(val normalizeNames: Boolean) {
val nameMap: MutableMap<IrVariableSymbol, String> = mutableMapOf()
var temporaryIndex: Int = 0
}
private fun IrVariable.normalizedName(data: VariableNameData): String {
internal fun IrVariable.normalizedName(data: VariableNameData): String {
if (data.normalizeNames && (origin == IrDeclarationOrigin.IR_TEMPORARY_VARIABLE || origin == IrDeclarationOrigin.FOR_LOOP_ITERATOR)) {
return data.nameMap.getOrPut(symbol) { "tmp_${data.temporaryIndex++}" }
}
@@ -14,14 +14,10 @@ import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
import org.jetbrains.kotlin.ir.symbols.*
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.CustomKotlinLikeDumpStrategy.Modifiers
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.utils.Printer
@@ -70,6 +66,7 @@ data class KotlinLikeDumpOptions(
val printElseAsTrue: Boolean = false,
val printUnitReturnType: Boolean = false,
val stableOrder: Boolean = false,
val normalizeNames: Boolean = false,
/*
TODO add more options:
always print visibility?
@@ -167,16 +164,21 @@ interface CustomKotlinLikeDumpStrategy {
* option?
* unique ids for symbols, or SignatureID?
* option?
* "normalize" names for tmps? ^^ Could unique ids help?
* wrap/escape invalid identifiers with "`", like "$$delegate"
*/
private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOptions) : IrElementVisitor<Unit, IrDeclaration?> {
private val variableNameData = VariableNameData(options.normalizeNames)
private val IrSymbol.safeName
get() = if (!isBound) {
"/* ERROR: unbound symbol $signature */"
} else {
(owner as? IrDeclarationWithName)?.name?.toString() ?: "/* ERROR: unnamed symbol $signature */"
when (val owner = owner) {
is IrVariable -> owner.normalizedName(variableNameData)
is IrDeclarationWithName -> owner.name.toString()
else -> "/* ERROR: unnamed symbol $signature */"
}
}
private val IrFunctionSymbol.safeValueParameters
@@ -923,7 +925,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
p(declaration.isLateinit, "lateinit")
p(declaration.isConst, "const")
declaration.run { printVariable(isVar, name, type) }
declaration.run { printVariable(isVar, normalizedName(variableNameData), type) }
declaration.initializer?.let {
p.printWithNoIndent(" = ")
@@ -936,7 +938,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
p.printIndent()
// TODO think about better rendering
declaration.run { printVariable(isVar, name, type) }
declaration.run { printVariable(isVar, name.asString(), type) }
p.printlnWithNoIndent()
p.pushIndent()
@@ -951,10 +953,10 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
p.printlnWithNoIndent()
}
private fun printVariable(isVar: Boolean, name: Name, type: IrType) {
private fun printVariable(isVar: Boolean, name: String, type: IrType) {
p.printWithNoIndent(if (isVar) "var" else "val")
p.printWithNoIndent(" ")
p.printWithNoIndent(name.asString())
p.printWithNoIndent(name)
p.printWithNoIndent(": ")
type.printTypeWithNoIndent()
}
@@ -105,33 +105,33 @@ data class Test1 {
when {
other !is Test1 -> return false
}
val tmp0_other_with_cast: Test1 = other as Test1
val tmp_0: Test1 = other as Test1
when {
EQEQ(arg0 = <this>.#stringArray, arg1 = tmp0_other_with_cast.#stringArray).not() -> return false
EQEQ(arg0 = <this>.#stringArray, arg1 = tmp_0.#stringArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#charArray, arg1 = tmp0_other_with_cast.#charArray).not() -> return false
EQEQ(arg0 = <this>.#charArray, arg1 = tmp_0.#charArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#booleanArray, arg1 = tmp0_other_with_cast.#booleanArray).not() -> return false
EQEQ(arg0 = <this>.#booleanArray, arg1 = tmp_0.#booleanArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#byteArray, arg1 = tmp0_other_with_cast.#byteArray).not() -> return false
EQEQ(arg0 = <this>.#byteArray, arg1 = tmp_0.#byteArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#shortArray, arg1 = tmp0_other_with_cast.#shortArray).not() -> return false
EQEQ(arg0 = <this>.#shortArray, arg1 = tmp_0.#shortArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#intArray, arg1 = tmp0_other_with_cast.#intArray).not() -> return false
EQEQ(arg0 = <this>.#intArray, arg1 = tmp_0.#intArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#longArray, arg1 = tmp0_other_with_cast.#longArray).not() -> return false
EQEQ(arg0 = <this>.#longArray, arg1 = tmp_0.#longArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#floatArray, arg1 = tmp0_other_with_cast.#floatArray).not() -> return false
EQEQ(arg0 = <this>.#floatArray, arg1 = tmp_0.#floatArray).not() -> return false
}
when {
EQEQ(arg0 = <this>.#doubleArray, arg1 = tmp0_other_with_cast.#doubleArray).not() -> return false
EQEQ(arg0 = <this>.#doubleArray, arg1 = tmp_0.#doubleArray).not() -> return false
}
return true
}
@@ -172,9 +172,9 @@ data class Test2<T : Any?> {
when {
other !is Test2<T> -> return false
}
val tmp0_other_with_cast: Test2<T> = other as Test2<T>
val tmp_1: Test2<T> = other as Test2<T>
when {
EQEQ(arg0 = <this>.#genericArray, arg1 = tmp0_other_with_cast.#genericArray).not() -> return false
EQEQ(arg0 = <this>.#genericArray, arg1 = tmp_1.#genericArray).not() -> return false
}
return true
}
@@ -218,9 +218,9 @@ data class Test3 {
when {
other !is Test3 -> return false
}
val tmp0_other_with_cast: Test3 = other as Test3
val tmp_2: Test3 = other as Test3
when {
EQEQ(arg0 = <this>.#anyArrayN, arg1 = tmp0_other_with_cast.#anyArrayN).not() -> return false
EQEQ(arg0 = <this>.#anyArrayN, arg1 = tmp_2.#anyArrayN).not() -> return false
}
return true
}
@@ -51,15 +51,15 @@ data class Test1 {
when {
other !is Test1 -> return false
}
val tmp0_other_with_cast: Test1 = other as Test1
val tmp_0: Test1 = other as Test1
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
when {
EQEQ(arg0 = <this>.#y, arg1 = tmp0_other_with_cast.#y).not() -> return false
EQEQ(arg0 = <this>.#y, arg1 = tmp_0.#y).not() -> return false
}
when {
EQEQ(arg0 = <this>.#z, arg1 = tmp0_other_with_cast.#z).not() -> return false
EQEQ(arg0 = <this>.#z, arg1 = tmp_0.#z).not() -> return false
}
return true
}
@@ -103,9 +103,9 @@ data class Test2 {
when {
other !is Test2 -> return false
}
val tmp0_other_with_cast: Test2 = other as Test2
val tmp_1: Test2 = other as Test2
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_1.#x).not() -> return false
}
return true
}
@@ -180,18 +180,18 @@ data class Test3 {
when {
other !is Test3 -> return false
}
val tmp0_other_with_cast: Test3 = other as Test3
val tmp_2: Test3 = other as Test3
when {
EQEQ(arg0 = <this>.#d, arg1 = tmp0_other_with_cast.#d).not() -> return false
EQEQ(arg0 = <this>.#d, arg1 = tmp_2.#d).not() -> return false
}
when {
EQEQ(arg0 = <this>.#dn, arg1 = tmp0_other_with_cast.#dn).not() -> return false
EQEQ(arg0 = <this>.#dn, arg1 = tmp_2.#dn).not() -> return false
}
when {
EQEQ(arg0 = <this>.#f, arg1 = tmp0_other_with_cast.#f).not() -> return false
EQEQ(arg0 = <this>.#f, arg1 = tmp_2.#f).not() -> return false
}
when {
EQEQ(arg0 = <this>.#df, arg1 = tmp0_other_with_cast.#df).not() -> return false
EQEQ(arg0 = <this>.#df, arg1 = tmp_2.#df).not() -> return false
}
return true
}
@@ -35,9 +35,9 @@ data class Test1<T : Any?> {
when {
other !is Test1<T> -> return false
}
val tmp0_other_with_cast: Test1<T> = other as Test1<T>
val tmp_0: Test1<T> = other as Test1<T>
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
return true
}
@@ -78,9 +78,9 @@ data class Test2<T : Number> {
when {
other !is Test2<T> -> return false
}
val tmp0_other_with_cast: Test2<T> = other as Test2<T>
val tmp_1: Test2<T> = other as Test2<T>
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_1.#x).not() -> return false
}
return true
}
@@ -121,9 +121,9 @@ data class Test3<T : Any?> {
when {
other !is Test3<T> -> return false
}
val tmp0_other_with_cast: Test3<T> = other as Test3<T>
val tmp_2: Test3<T> = other as Test3<T>
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_2.#x).not() -> return false
}
return true
}
@@ -164,9 +164,9 @@ data class Test4 {
when {
other !is Test4 -> return false
}
val tmp0_other_with_cast: Test4 = other as Test4
val tmp_3: Test4 = other as Test4
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_3.#x).not() -> return false
}
return true
}
@@ -20,7 +20,7 @@ data object DataObject {
when {
other !is DataObject -> return false
}
val tmp0_other_with_cast: DataObject = other as DataObject
val tmp_0: DataObject = other as DataObject
return true
}
@@ -52,9 +52,9 @@ sealed class A : CharSequence {
when {
other !is B -> return false
}
val tmp0_other_with_cast: B = other as B
val tmp_0: B = other as B
when {
EQEQ(arg0 = <this>.#c, arg1 = tmp0_other_with_cast.#c).not() -> return false
EQEQ(arg0 = <this>.#c, arg1 = tmp_0.#c).not() -> return false
}
return true
}
@@ -52,9 +52,9 @@ sealed class A : CharSequence {
when {
other !is B -> return false
}
val tmp0_other_with_cast: B = other as B
val tmp_0: B = other as B
when {
EQEQ(arg0 = <this>.#c, arg1 = tmp0_other_with_cast.#c).not() -> return false
EQEQ(arg0 = <this>.#c, arg1 = tmp_0.#c).not() -> return false
}
return true
}
@@ -35,9 +35,9 @@ data class TestData {
when {
other !is TestData -> return false
}
val tmp0_other_with_cast: TestData = other as TestData
val tmp_0: TestData = other as TestData
when {
EQEQ(arg0 = <this>.#nn, arg1 = tmp0_other_with_cast.#nn).not() -> return false
EQEQ(arg0 = <this>.#nn, arg1 = tmp_0.#nn).not() -> return false
}
return true
}
@@ -70,9 +70,9 @@ value class TestInline {
when {
other !is TestInline -> return false
}
val tmp0_other_with_cast: TestInline = other as TestInline
val tmp_1: TestInline = other as TestInline
when {
EQEQ(arg0 = <this>.#nn, arg1 = tmp0_other_with_cast.#nn).not() -> return false
EQEQ(arg0 = <this>.#nn, arg1 = tmp_1.#nn).not() -> return false
}
return true
}
@@ -35,9 +35,9 @@ data class A {
when {
other !is A -> return false
}
val tmp0_other_with_cast: A = other as A
val tmp_0: A = other as A
when {
EQEQ(arg0 = <this>.#runA, arg1 = tmp0_other_with_cast.#runA).not() -> return false
EQEQ(arg0 = <this>.#runA, arg1 = tmp_0.#runA).not() -> return false
}
return true
}
@@ -89,9 +89,9 @@ data class B {
when {
other !is B -> return false
}
val tmp0_other_with_cast: B = other as B
val tmp_1: B = other as B
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_1.#x).not() -> return false
}
return true
}
@@ -35,9 +35,9 @@ data class A {
when {
other !is A -> return false
}
val tmp0_other_with_cast: A = other as A
val tmp_0: A = other as A
when {
EQEQ(arg0 = <this>.#runA, arg1 = tmp0_other_with_cast.#runA).not() -> return false
EQEQ(arg0 = <this>.#runA, arg1 = tmp_0.#runA).not() -> return false
}
return true
}
@@ -89,9 +89,9 @@ data class B {
when {
other !is B -> return false
}
val tmp0_other_with_cast: B = other as B
val tmp_1: B = other as B
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_1.#x).not() -> return false
}
return true
}
@@ -43,12 +43,12 @@ open data class ValidatedProperties {
when {
other !is ValidatedProperties -> return false
}
val tmp0_other_with_cast: ValidatedProperties = other as ValidatedProperties
val tmp_0: ValidatedProperties = other as ValidatedProperties
when {
EQEQ(arg0 = <this>.<get-test1>(), arg1 = tmp0_other_with_cast.<get-test1>()).not() -> return false
EQEQ(arg0 = <this>.<get-test1>(), arg1 = tmp_0.<get-test1>()).not() -> return false
}
when {
EQEQ(arg0 = <this>.<get-test2>(), arg1 = tmp0_other_with_cast.<get-test2>()).not() -> return false
EQEQ(arg0 = <this>.<get-test2>(), arg1 = tmp_0.<get-test2>()).not() -> return false
}
return true
}
+3 -3
View File
@@ -179,9 +179,9 @@ enum class TestEnum6 : Enum<TestEnum6> {
get
TEST = { // BLOCK
val tmp0_y: Int = f()
val tmp1_x: Int = f()
TestEnum6(x = tmp1_x, y = tmp0_y)
val tmp_0: Int = f()
val tmp_1: Int = f()
TestEnum6(x = tmp_1, y = tmp_0)
}
fun values(): Array<TestEnum6> /* Synthetic body for ENUM_VALUES */
+3 -3
View File
@@ -179,9 +179,9 @@ enum class TestEnum6 : Enum<TestEnum6> {
get
TEST = { // BLOCK
val tmp0_y: Int = f()
val tmp1_x: Int = f()
TestEnum6(x = tmp1_x, y = tmp0_y)
val tmp_0: Int = f()
val tmp_1: Int = f()
TestEnum6(x = tmp_1, y = tmp_0)
}
fun values(): Array<TestEnum6> /* Synthetic body for ENUM_VALUES */
+2 -2
View File
@@ -21,9 +21,9 @@ value class Test {
when {
other !is Test -> return false
}
val tmp0_other_with_cast: Test = other as Test
val tmp_0: Test = other as Test
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
return true
}
@@ -42,9 +42,9 @@ value class IC<TT : Any?> {
when {
other !is IC<TT> -> return false
}
val tmp0_other_with_cast: IC<TT> = other as IC<TT>
val tmp_0: IC<TT> = other as IC<TT>
when {
EQEQ(arg0 = <this>.#c, arg1 = tmp0_other_with_cast.#c).not() -> return false
EQEQ(arg0 = <this>.#c, arg1 = tmp_0.#c).not() -> return false
}
return true
}
@@ -33,9 +33,9 @@ data class MyContainer {
when {
other !is MyContainer -> return false
}
val tmp0_other_with_cast: MyContainer = other as MyContainer
val tmp_0: MyContainer = other as MyContainer
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -69,9 +69,9 @@ fun box(): String {
var myContainer: MyContainer = MyContainer(i = 0)
with<Int, Unit>(receiver = 1, block = local fun Int.<anonymous>() {
myContainer.plusAssign($context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK
val <unary>: MyContainer = myContainer
myContainer = <unary>.inc($context_receiver_0 = $this$with)
<unary>
val tmp_1: MyContainer = myContainer
myContainer = tmp_1.inc($context_receiver_0 = $this$with)
tmp_1
}.get($context_receiver_0 = $this$with, index = 0)))
}
)
@@ -33,9 +33,9 @@ data class MyContainer {
when {
other !is MyContainer -> return false
}
val tmp0_other_with_cast: MyContainer = other as MyContainer
val tmp_0: MyContainer = other as MyContainer
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -62,8 +62,8 @@ operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = $context_receiver_0))
}
{ // BLOCK
val tmp0_this: MyContainer = <this>
tmp0_this.<set-i>(<set-?> = tmp0_this.<get-i>().plus(other = other.<get-i>()))
val tmp_1: MyContainer = <this>
tmp_1.<set-i>(<set-?> = tmp_1.<get-i>().plus(other = other.<get-i>()))
}
}
@@ -78,9 +78,9 @@ fun box(): String {
var myContainer: MyContainer = MyContainer(i = 0)
with<Int, Unit>(receiver = 1, block = local fun Int.<anonymous>() {
myContainer.plusAssign($context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK
val tmp0: MyContainer = myContainer
myContainer = tmp0.inc($context_receiver_0 = $this$with)
tmp0
val tmp_2: MyContainer = myContainer
myContainer = tmp_2.inc($context_receiver_0 = $this$with)
tmp_2
}.get($context_receiver_0 = $this$with, index = 0)))
}
)
@@ -33,9 +33,9 @@ data class MyContainer {
when {
other !is MyContainer -> return false
}
val tmp0_other_with_cast: MyContainer = other as MyContainer
val tmp_0: MyContainer = other as MyContainer
when {
EQEQ(arg0 = <this>.#s, arg1 = tmp0_other_with_cast.#s).not() -> return false
EQEQ(arg0 = <this>.#s, arg1 = tmp_0.#s).not() -> return false
}
return true
}
@@ -67,10 +67,10 @@ fun box(): String {
val myContainer: MyContainer = MyContainer(s = "fail")
myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK")
return { // BLOCK
val <elvis>: String? = myContainer.get($context_receiver_0 = $this$with, index = 0)
val tmp_1: String? = myContainer.get($context_receiver_0 = $this$with, index = 0)
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> "fail"
else -> <elvis>
EQEQ(arg0 = tmp_1, arg1 = null) -> "fail"
else -> tmp_1
}
}
}
@@ -33,9 +33,9 @@ data class MyContainer {
when {
other !is MyContainer -> return false
}
val tmp0_other_with_cast: MyContainer = other as MyContainer
val tmp_0: MyContainer = other as MyContainer
when {
EQEQ(arg0 = <this>.#s, arg1 = tmp0_other_with_cast.#s).not() -> return false
EQEQ(arg0 = <this>.#s, arg1 = tmp_0.#s).not() -> return false
}
return true
}
@@ -67,10 +67,10 @@ fun box(): String {
val myContainer: MyContainer = MyContainer(s = "fail")
myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK")
return { // BLOCK
val tmp0_elvis_lhs: String? = myContainer.get($context_receiver_0 = $this$with, index = 0)
val tmp_1: String? = myContainer.get($context_receiver_0 = $this$with, index = 0)
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> "fail"
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_1, arg1 = null) -> "fail"
else -> tmp_1
}
}
}
@@ -33,9 +33,9 @@ data class Result {
when {
other !is Result -> return false
}
val tmp0_other_with_cast: Result = other as Result
val tmp_0: Result = other as Result
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -33,9 +33,9 @@ data class Result {
when {
other !is Result -> return false
}
val tmp0_other_with_cast: Result = other as Result
val tmp_0: Result = other as Result
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -59,8 +59,8 @@ operator fun Result.plusAssign($context_receiver_0: Int, other: Result) {
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = $context_receiver_0))
}
{ // BLOCK
val tmp0_this: Result = <this>
tmp0_this.<set-i>(<set-?> = tmp0_this.<get-i>().plus(other = other.<get-i>()))
val tmp_1: Result = <this>
tmp_1.<set-i>(<set-?> = tmp_1.<get-i>().plus(other = other.<get-i>()))
}
}
@@ -76,8 +76,8 @@ operator fun Result.minusAssign($context_receiver_0: Int, other: Result) {
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = $context_receiver_0))
}
{ // BLOCK
val tmp0_this: Result = <this>
tmp0_this.<set-i>(<set-?> = tmp0_this.<get-i>().minus(other = other.<get-i>()))
val tmp_2: Result = <this>
tmp_2.<set-i>(<set-?> = tmp_2.<get-i>().minus(other = other.<get-i>()))
}
}
@@ -93,8 +93,8 @@ operator fun Result.timesAssign($context_receiver_0: Int, other: Result) {
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = $context_receiver_0))
}
{ // BLOCK
val tmp0_this: Result = <this>
tmp0_this.<set-i>(<set-?> = tmp0_this.<get-i>().times(other = other.<get-i>()))
val tmp_3: Result = <this>
tmp_3.<set-i>(<set-?> = tmp_3.<get-i>().times(other = other.<get-i>()))
}
}
@@ -110,8 +110,8 @@ operator fun Result.divAssign($context_receiver_0: Int, other: Result) {
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = $context_receiver_0))
}
{ // BLOCK
val tmp0_this: Result = <this>
tmp0_this.<set-i>(<set-?> = tmp0_this.<get-i>().div(other = other.<get-i>()))
val tmp_4: Result = <this>
tmp_4.<set-i>(<set-?> = tmp_4.<get-i>().div(other = other.<get-i>()))
}
}
@@ -48,12 +48,12 @@ data class Pair<A : Any?, B : Any?> {
when {
other !is Pair<A, B> -> return false
}
val tmp0_other_with_cast: Pair<A, B> = other as Pair<A, B>
val tmp_0: Pair<A, B> = other as Pair<A, B>
when {
EQEQ(arg0 = <this>.#first, arg1 = tmp0_other_with_cast.#first).not() -> return false
EQEQ(arg0 = <this>.#first, arg1 = tmp_0.#first).not() -> return false
}
when {
EQEQ(arg0 = <this>.#second, arg1 = tmp0_other_with_cast.#second).not() -> return false
EQEQ(arg0 = <this>.#second, arg1 = tmp_0.#second).not() -> return false
}
return true
}
@@ -48,12 +48,12 @@ data class Pair<A : Any?, B : Any?> {
when {
other !is Pair<A, B> -> return false
}
val tmp0_other_with_cast: Pair<A, B> = other as Pair<A, B>
val tmp_0: Pair<A, B> = other as Pair<A, B>
when {
EQEQ(arg0 = <this>.#first, arg1 = tmp0_other_with_cast.#first).not() -> return false
EQEQ(arg0 = <this>.#first, arg1 = tmp_0.#first).not() -> return false
}
when {
EQEQ(arg0 = <this>.#second, arg1 = tmp0_other_with_cast.#second).not() -> return false
EQEQ(arg0 = <this>.#second, arg1 = tmp_0.#second).not() -> return false
}
return true
}
@@ -33,9 +33,9 @@ data class Counter {
when {
other !is Counter -> return false
}
val tmp0_other_with_cast: Counter = other as Counter
val tmp_0: Counter = other as Counter
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -76,9 +76,9 @@ data class CounterConfig {
when {
other !is CounterConfig -> return false
}
val tmp0_other_with_cast: CounterConfig = other as CounterConfig
val tmp_1: CounterConfig = other as CounterConfig
when {
EQEQ(arg0 = <this>.#max, arg1 = tmp0_other_with_cast.#max).not() -> return false
EQEQ(arg0 = <this>.#max, arg1 = tmp_1.#max).not() -> return false
}
return true
}
@@ -104,10 +104,10 @@ class CounterIterator : Iterator<Int> {
override operator fun next(): Int {
return { // BLOCK
val <receiver>: Counter = <this>.<get-counter>()
val <unary>: Int = <receiver>.<get-i>()
<receiver>.<set-i>(<set-?> = <unary>.inc())
<unary>
val tmp_2: Counter = <this>.<get-counter>()
val tmp_3: Int = tmp_2.<get-i>()
tmp_2.<set-i>(<set-?> = tmp_3.inc())
tmp_3
}
}
@@ -124,9 +124,9 @@ fun box(): String {
var result: Int = 0
with<CounterConfig, Unit>(receiver = CounterConfig(), block = local fun CounterConfig.<anonymous>() {
{ // BLOCK
val <iterator>: CounterIterator = Counter().iterator($context_receiver_0 = $this$with)
while (<iterator>.hasNext()) { // BLOCK
val i: Int = <iterator>.next()
val tmp_4: CounterIterator = Counter().iterator($context_receiver_0 = $this$with)
while (tmp_4.hasNext()) { // BLOCK
val i: Int = tmp_4.next()
{ // BLOCK
result = result.plus(other = i)
}
@@ -33,9 +33,9 @@ data class Counter {
when {
other !is Counter -> return false
}
val tmp0_other_with_cast: Counter = other as Counter
val tmp_0: Counter = other as Counter
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -76,9 +76,9 @@ data class CounterConfig {
when {
other !is CounterConfig -> return false
}
val tmp0_other_with_cast: CounterConfig = other as CounterConfig
val tmp_1: CounterConfig = other as CounterConfig
when {
EQEQ(arg0 = <this>.#max, arg1 = tmp0_other_with_cast.#max).not() -> return false
EQEQ(arg0 = <this>.#max, arg1 = tmp_1.#max).not() -> return false
}
return true
}
@@ -104,11 +104,11 @@ class CounterIterator : Iterator<Int> {
override operator fun next(): Int {
return { // BLOCK
val tmp0_this: Counter = <this>.<get-counter>()
val tmp_2: Counter = <this>.<get-counter>()
{ // BLOCK
val tmp1: Int = tmp0_this.<get-i>()
tmp0_this.<set-i>(<set-?> = tmp1.inc())
tmp1
val tmp_3: Int = tmp_2.<get-i>()
tmp_2.<set-i>(<set-?> = tmp_3.inc())
tmp_3
}
}
}
@@ -126,9 +126,9 @@ fun box(): String {
var result: Int = 0
with<CounterConfig, Unit>(receiver = CounterConfig(), block = local fun CounterConfig.<anonymous>() {
{ // BLOCK
val tmp0_iterator: CounterIterator = Counter().iterator($context_receiver_0 = $this$with)
while (tmp0_iterator.hasNext()) { // BLOCK
val i: Int = tmp0_iterator.next()
val tmp_4: CounterIterator = Counter().iterator($context_receiver_0 = $this$with)
while (tmp_4.hasNext()) { // BLOCK
val i: Int = tmp_4.next()
{ // BLOCK
result = result.plus(other = i)
}
@@ -32,9 +32,9 @@ data class Result {
when {
other !is Result -> return false
}
val tmp0_other_with_cast: Result = other as Result
val tmp_0: Result = other as Result
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -73,21 +73,21 @@ fun box(): String {
var result: Result = Result(i = 0)
with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
{ // BLOCK
val <unary>: Result = result
result = <unary>.inc($context_receiver_0 = $this$with)
<unary>
val tmp_1: Result = result
result = tmp_1.inc($context_receiver_0 = $this$with)
tmp_1
} /*~> Unit */
{ // BLOCK
val <unary>: Result = result
result = <unary>.inc($context_receiver_0 = $this$with)
<unary>
val tmp_2: Result = result
result = tmp_2.inc($context_receiver_0 = $this$with)
tmp_2
} /*~> Unit */
result.unaryMinus($context_receiver_0 = $this$with) /*~> Unit */
result.unaryPlus($context_receiver_0 = $this$with) /*~> Unit */
return { // BLOCK
val <unary>: Result = result
result = <unary>.dec($context_receiver_0 = $this$with)
<unary>
val tmp_3: Result = result
result = tmp_3.dec($context_receiver_0 = $this$with)
tmp_3
}
}
) /*~> Unit */
@@ -32,9 +32,9 @@ data class Result {
when {
other !is Result -> return false
}
val tmp0_other_with_cast: Result = other as Result
val tmp_0: Result = other as Result
when {
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
EQEQ(arg0 = <this>.#i, arg1 = tmp_0.#i).not() -> return false
}
return true
}
@@ -81,21 +81,21 @@ fun box(): String {
var result: Result = Result(i = 0)
with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
{ // BLOCK
val tmp0: Result = result
result = tmp0.inc($context_receiver_0 = $this$with)
tmp0
val tmp_1: Result = result
result = tmp_1.inc($context_receiver_0 = $this$with)
tmp_1
} /*~> Unit */
{ // BLOCK
val tmp1: Result = result
result = tmp1.inc($context_receiver_0 = $this$with)
tmp1
val tmp_2: Result = result
result = tmp_2.inc($context_receiver_0 = $this$with)
tmp_2
} /*~> Unit */
result.unaryMinus($context_receiver_0 = $this$with) /*~> Unit */
result.unaryPlus($context_receiver_0 = $this$with) /*~> Unit */
return { // BLOCK
val tmp2: Result = result
result = tmp2.dec($context_receiver_0 = $this$with)
tmp2
val tmp_3: Result = result
result = tmp_3.dec($context_receiver_0 = $this$with)
tmp_3
}
}
) /*~> Unit */
@@ -21,9 +21,9 @@ value class IT {
when {
other !is IT -> return false
}
val tmp0_other_with_cast: IT = other as IT
val tmp_0: IT = other as IT
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
return true
}
@@ -98,9 +98,9 @@ value class InlineMutableSet : MutableSet<IT> {
when {
other !is InlineMutableSet -> return false
}
val tmp0_other_with_cast: InlineMutableSet = other as InlineMutableSet
val tmp_1: InlineMutableSet = other as InlineMutableSet
when {
EQEQ(arg0 = <this>.#ms, arg1 = tmp0_other_with_cast.#ms).not() -> return false
EQEQ(arg0 = <this>.#ms, arg1 = tmp_1.#ms).not() -> return false
}
return true
}
@@ -21,9 +21,9 @@ value class IT {
when {
other !is IT -> return false
}
val tmp0_other_with_cast: IT = other as IT
val tmp_0: IT = other as IT
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
return true
}
@@ -98,9 +98,9 @@ value class InlineMutableSet : MutableSet<IT> {
when {
other !is InlineMutableSet -> return false
}
val tmp0_other_with_cast: InlineMutableSet = other as InlineMutableSet
val tmp_1: InlineMutableSet = other as InlineMutableSet
when {
EQEQ(arg0 = <this>.#ms, arg1 = tmp0_other_with_cast.#ms).not() -> return false
EQEQ(arg0 = <this>.#ms, arg1 = tmp_1.#ms).not() -> return false
}
return true
}
@@ -33,9 +33,9 @@ data class MyRec : Record {
when {
other !is MyRec -> return false
}
val tmp0_other_with_cast: MyRec = other as MyRec
val tmp_0: MyRec = other as MyRec
when {
EQEQ(arg0 = <this>.#name, arg1 = tmp0_other_with_cast.#name).not() -> return false
EQEQ(arg0 = <this>.#name, arg1 = tmp_0.#name).not() -> return false
}
return true
}
@@ -33,9 +33,9 @@ data class MyRec : Record {
when {
other !is MyRec -> return false
}
val tmp0_other_with_cast: MyRec = other as MyRec
val tmp_0: MyRec = other as MyRec
when {
EQEQ(arg0 = <this>.#name, arg1 = tmp0_other_with_cast.#name).not() -> return false
EQEQ(arg0 = <this>.#name, arg1 = tmp_0.#name).not() -> return false
}
return true
}
+12 -12
View File
@@ -1,9 +1,9 @@
fun test_1(value: Any?): String? {
return { // BLOCK
val tmp0_safe_receiver: Any? = value
val tmp_0: Any? = value
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "O"
}
)
@@ -14,10 +14,10 @@ fun test_1(value: Any?): String? {
fun test_2(value: Any?): String? {
return run<String?>(block = local fun <anonymous>(): String? {
return { // BLOCK
val tmp1_safe_receiver: Any? = value
val tmp_1: Any? = value
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "K"
}
)
@@ -30,17 +30,17 @@ fun test_2(value: Any?): String? {
fun box(): String {
var result: String = ""
result = result.plus(other = { // BLOCK
val <elvis>: String? = test_1(value = 1)
val tmp_2: String? = test_1(value = 1)
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> return "fail 1"
else -> <elvis>
EQEQ(arg0 = tmp_2, arg1 = null) -> return "fail 1"
else -> tmp_2
}
})
result = result.plus(other = { // BLOCK
val <elvis>: String? = test_2(value = 1)
val tmp_3: String? = test_2(value = 1)
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> return "fail 2"
else -> <elvis>
EQEQ(arg0 = tmp_3, arg1 = null) -> return "fail 2"
else -> tmp_3
}
})
return result
+12 -12
View File
@@ -1,9 +1,9 @@
fun test_1(value: Any?): String? {
return { // BLOCK
val tmp0_safe_receiver: Any? = value
val tmp_0: Any? = value
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "O"
}
)
@@ -14,10 +14,10 @@ fun test_1(value: Any?): String? {
fun test_2(value: Any?): String? {
return run<Nothing?>(block = local fun <anonymous>(): Nothing? {
return { // BLOCK
val tmp0_safe_receiver: Any? = value
val tmp_1: Any? = value
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "K"
}
)
@@ -30,17 +30,17 @@ fun test_2(value: Any?): String? {
fun box(): String {
var result: String = ""
result = result.plus(other = { // BLOCK
val tmp0_elvis_lhs: String? = test_1(value = 1)
val tmp_2: String? = test_1(value = 1)
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> return "fail 1"
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_2, arg1 = null) -> return "fail 1"
else -> tmp_2
}
})
result = result.plus(other = { // BLOCK
val tmp1_elvis_lhs: String? = test_2(value = 1)
val tmp_3: String? = test_2(value = 1)
when {
EQEQ(arg0 = tmp1_elvis_lhs, arg1 = null) -> return "fail 2"
else -> tmp1_elvis_lhs
EQEQ(arg0 = tmp_3, arg1 = null) -> return "fail 2"
else -> tmp_3
}
})
return result
@@ -47,9 +47,9 @@ data class LoginSuccessPacket {
when {
other !is LoginSuccessPacket -> return false
}
val tmp0_other_with_cast: LoginSuccessPacket = other as LoginSuccessPacket
val tmp_0: LoginSuccessPacket = other as LoginSuccessPacket
when {
EQEQ(arg0 = <this>.#id, arg1 = tmp0_other_with_cast.#id).not() -> return false
EQEQ(arg0 = <this>.#id, arg1 = tmp_0.#id).not() -> return false
}
return true
}
+2 -2
View File
@@ -46,9 +46,9 @@ data class LoginSuccessPacket {
when {
other !is LoginSuccessPacket -> return false
}
val tmp0_other_with_cast: LoginSuccessPacket = other as LoginSuccessPacket
val tmp_0: LoginSuccessPacket = other as LoginSuccessPacket
when {
EQEQ(arg0 = <this>.#id, arg1 = tmp0_other_with_cast.#id).not() -> return false
EQEQ(arg0 = <this>.#id, arg1 = tmp_0.#id).not() -> return false
}
return true
}
@@ -23,9 +23,9 @@ fun test2() {
<set-x>(<set-?> = 0)
{ // BLOCK
val <unary>: Int = <get-x>()
<set-x>(<set-?> = <unary>.inc())
<unary>
val tmp_0: Int = <get-x>()
<set-x>(<set-?> = tmp_0.inc())
tmp_0
} /*~> Unit */
<set-x>(<set-?> = <get-x>().plus(other = 1))
}
@@ -23,9 +23,9 @@ fun test2() {
<set-x>(value = 0)
{ // BLOCK
val tmp0: Int = <get-x>()
<set-x>(value = tmp0.inc())
tmp0
val tmp_0: Int = <get-x>()
<set-x>(value = tmp_0.inc())
tmp_0
} /*~> Unit */
<set-x>(value = <get-x>().plus(other = 1))
}
@@ -45,12 +45,12 @@ data class Test<T : Any?> {
when {
other !is Test<T> -> return false
}
val tmp0_other_with_cast: Test<T> = other as Test<T>
val tmp_0: Test<T> = other as Test<T>
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
when {
EQEQ(arg0 = <this>.#y, arg1 = tmp0_other_with_cast.#y).not() -> return false
EQEQ(arg0 = <this>.#y, arg1 = tmp_0.#y).not() -> return false
}
return true
}
@@ -22,24 +22,24 @@ class C {
fun testVariable() {
var x: IntArray = foo()
{ // BLOCK
val <array>: IntArray = x
val <index_0>: Int = 0
<array>.set(index = <index_0>, value = <array>.get(index = <index_0>).plus(other = 1))
val tmp_0: IntArray = x
val tmp_1: Int = 0
tmp_0.set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 1))
}
}
fun testCall() {
{ // BLOCK
val <array>: IntArray = foo()
val <index_0>: Int = bar()
<array>.set(index = <index_0>, value = <array>.get(index = <index_0>).times(other = 2))
val tmp_2: IntArray = foo()
val tmp_3: Int = bar()
tmp_2.set(index = tmp_3, value = tmp_2.get(index = tmp_3).times(other = 2))
}
}
fun testMember(c: C) {
val <array>: IntArray = c.<get-x>()
val <index_0>: Int = 0
val <unary>: Int = <array>.get(index = <index_0>)
<array>.set(index = <index_0>, value = <unary>.inc())
<unary> /*~> Unit */
val tmp_4: IntArray = c.<get-x>()
val tmp_5: Int = 0
val tmp_6: Int = tmp_4.get(index = tmp_5)
tmp_4.set(index = tmp_5, value = tmp_6.inc())
tmp_6 /*~> Unit */
}
@@ -22,26 +22,26 @@ class C {
fun testVariable() {
var x: IntArray = foo()
{ // BLOCK
val tmp0_array: IntArray = x
val tmp1_index0: Int = 0
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 1))
val tmp_0: IntArray = x
val tmp_1: Int = 0
tmp_0.set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 1))
}
}
fun testCall() {
{ // BLOCK
val tmp0_array: IntArray = foo()
val tmp1_index0: Int = bar()
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).times(other = 2))
val tmp_2: IntArray = foo()
val tmp_3: Int = bar()
tmp_2.set(index = tmp_3, value = tmp_2.get(index = tmp_3).times(other = 2))
}
}
fun testMember(c: C) {
{ // BLOCK
val tmp0_array: IntArray = c.<get-x>()
val tmp1_index0: Int = 0
val tmp2: Int = tmp0_array.get(index = tmp1_index0)
tmp0_array.set(index = tmp1_index0, value = tmp2.inc())
tmp2
val tmp_4: IntArray = c.<get-x>()
val tmp_5: Int = 0
val tmp_6: Int = tmp_4.get(index = tmp_5)
tmp_4.set(index = tmp_5, value = tmp_6.inc())
tmp_6
} /*~> Unit */
}
@@ -10,8 +10,8 @@ interface IB {
fun IB.test(a: IA) {
{ // BLOCK
val <array>: IA = a
val <index_0>: String = ""
(<this>, <array>).set(index = <index_0>, value = <array>.get(index = <index_0>).plus(other = 42))
val tmp_0: IA = a
val tmp_1: String = ""
(<this>, tmp_0).set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 42))
}
}
@@ -10,8 +10,8 @@ interface IB {
fun IB.test(a: IA) {
{ // BLOCK
val tmp0_array: IA = a
val tmp1_index0: String = ""
(<this>, tmp0_array).set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 42))
val tmp_0: IA = a
val tmp_1: String = ""
(<this>, tmp_0).set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 42))
}
}
@@ -13,9 +13,9 @@ inline fun baz(crossinline block: Function0<Unit>) {
inline fun <T : Any?> Iterable<T>.myForEach(action: Function1<T, Unit>) {
{ // BLOCK
val tmp0_iterator: Iterator<T> = <this>.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val element: T = tmp0_iterator.next()
val tmp_0: Iterator<T> = <this>.iterator()
while (tmp_0.hasNext()) { // BLOCK
val element: T = tmp_0.next()
action.invoke(p1 = element)
}
}
@@ -4,10 +4,10 @@ fun test1(a: Any?): Any {
fun test2(a: Any?): Int {
return CHECK_NOT_NULL<Int>(arg0 = { // BLOCK
val tmp0_safe_receiver: Any? = a
val tmp_0: Any? = a
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.hashCode()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.hashCode()
}
})
}
+3 -3
View File
@@ -4,10 +4,10 @@ fun test1(a: Any?): Any {
fun test2(a: Any?): Int {
return CHECK_NOT_NULL<Int>(arg0 = { // BLOCK
val tmp0_safe_receiver: Any? = a
val tmp_0: Any? = a
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.hashCode()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.hashCode()
}
})
}
@@ -1,10 +1,10 @@
fun test1(c: Boolean?) {
L@ while (true) { // BLOCK
L2@ while ({ // BLOCK
val <elvis>: Boolean? = c
val tmp_0: Boolean? = c
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> break@L
else -> <elvis>
EQEQ(arg0 = tmp_0, arg1 = null) -> break@L
else -> tmp_0
}
})
}
@@ -13,10 +13,10 @@ fun test1(c: Boolean?) {
fun test2(c: Boolean?) {
L@ while (true) { // BLOCK
L2@ while ({ // BLOCK
val <elvis>: Boolean? = c
val tmp_1: Boolean? = c
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> continue@L
else -> <elvis>
EQEQ(arg0 = tmp_1, arg1 = null) -> continue@L
else -> tmp_1
}
})
}
@@ -25,15 +25,15 @@ fun test2(c: Boolean?) {
fun test3(ss: List<String>?) {
L@ while (true) { // BLOCK
{ // BLOCK
val <iterator>: Iterator<String> = { // BLOCK
val <elvis>: List<String>? = ss
val tmp_2: Iterator<String> = { // BLOCK
val tmp_3: List<String>? = ss
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> continue@L
else -> <elvis>
EQEQ(arg0 = tmp_3, arg1 = null) -> continue@L
else -> tmp_3
}
}.iterator()
L2@ while (<iterator>.hasNext()) { // BLOCK
val s: String = <iterator>.next()
L2@ while (tmp_2.hasNext()) { // BLOCK
val s: String = tmp_2.next()
}
}
}
@@ -42,15 +42,15 @@ fun test3(ss: List<String>?) {
fun test4(ss: List<String>?) {
L@ while (true) { // BLOCK
{ // BLOCK
val <iterator>: Iterator<String> = { // BLOCK
val <elvis>: List<String>? = ss
val tmp_4: Iterator<String> = { // BLOCK
val tmp_5: List<String>? = ss
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> break@L
else -> <elvis>
EQEQ(arg0 = tmp_5, arg1 = null) -> break@L
else -> tmp_5
}
}.iterator()
L2@ while (<iterator>.hasNext()) { // BLOCK
val s: String = <iterator>.next()
L2@ while (tmp_4.hasNext()) { // BLOCK
val s: String = tmp_4.next()
}
}
}
@@ -1,10 +1,10 @@
fun test1(c: Boolean?) {
L@ while (true) { // BLOCK
L2@ while ({ // BLOCK
val tmp0_elvis_lhs: Boolean? = c
val tmp_0: Boolean? = c
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> break
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_0, arg1 = null) -> break
else -> tmp_0
}
})
}
@@ -13,10 +13,10 @@ fun test1(c: Boolean?) {
fun test2(c: Boolean?) {
L@ while (true) { // BLOCK
L2@ while ({ // BLOCK
val tmp0_elvis_lhs: Boolean? = c
val tmp_1: Boolean? = c
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> continue
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_1, arg1 = null) -> continue
else -> tmp_1
}
})
}
@@ -25,15 +25,15 @@ fun test2(c: Boolean?) {
fun test3(ss: List<String>?) {
L@ while (true) { // BLOCK
{ // BLOCK
val tmp1_iterator: Iterator<String> = { // BLOCK
val tmp0_elvis_lhs: List<String>? = ss
val tmp_2: Iterator<String> = { // BLOCK
val tmp_3: List<String>? = ss
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> continue
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_3, arg1 = null) -> continue
else -> tmp_3
}
}.iterator()
L2@ while (tmp1_iterator.hasNext()) { // BLOCK
val s: String = tmp1_iterator.next()
L2@ while (tmp_2.hasNext()) { // BLOCK
val s: String = tmp_2.next()
}
}
}
@@ -42,15 +42,15 @@ fun test3(ss: List<String>?) {
fun test4(ss: List<String>?) {
L@ while (true) { // BLOCK
{ // BLOCK
val tmp1_iterator: Iterator<String> = { // BLOCK
val tmp0_elvis_lhs: List<String>? = ss
val tmp_4: Iterator<String> = { // BLOCK
val tmp_5: List<String>? = ss
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> break
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_5, arg1 = null) -> break
else -> tmp_5
}
}.iterator()
L2@ while (tmp1_iterator.hasNext()) { // BLOCK
val s: String = tmp1_iterator.next()
L2@ while (tmp_4.hasNext()) { // BLOCK
val s: String = tmp_4.next()
}
}
}
@@ -5,9 +5,9 @@ fun testBreakFor() {
)
var k: Int = 0
{ // BLOCK
val <iterator>: IntIterator = xs.iterator()
while (<iterator>.hasNext()) { // BLOCK
val x: Int = <iterator>.next()
val tmp_0: IntIterator = xs.iterator()
while (tmp_0.hasNext()) { // BLOCK
val x: Int = tmp_0.next()
{ // BLOCK
when {
greater(arg0 = k, arg1 = 2) -> break
@@ -44,9 +44,9 @@ fun testContinueFor() {
)
var k: Int = 0
{ // BLOCK
val <iterator>: IntIterator = xs.iterator()
while (<iterator>.hasNext()) { // BLOCK
val x: Int = <iterator>.next()
val tmp_1: IntIterator = xs.iterator()
while (tmp_1.hasNext()) { // BLOCK
val x: Int = tmp_1.next()
{ // BLOCK
when {
greater(arg0 = k, arg1 = 2) -> continue
@@ -5,9 +5,9 @@ fun testBreakFor() {
)
var k: Int = 0
{ // BLOCK
val tmp0_iterator: IntIterator = xs.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val x: Int = tmp0_iterator.next()
val tmp_0: IntIterator = xs.iterator()
while (tmp_0.hasNext()) { // BLOCK
val x: Int = tmp_0.next()
{ // BLOCK
when {
greater(arg0 = k, arg1 = 2) -> break
@@ -44,9 +44,9 @@ fun testContinueFor() {
)
var k: Int = 0
{ // BLOCK
val tmp0_iterator: IntIterator = xs.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val x: Int = tmp0_iterator.next()
val tmp_1: IntIterator = xs.iterator()
while (tmp_1.hasNext()) { // BLOCK
val x: Int = tmp_1.next()
{ // BLOCK
when {
greater(arg0 = k, arg1 = 2) -> continue
@@ -20,12 +20,12 @@ fun reordered2(): Int {
fun test() {
foo(a = noReorder1(), b = noReorder2())
{ // BLOCK
val tmp0_b: Int = reordered1()
val tmp1_a: Int = reordered2()
foo(a = tmp1_a, b = tmp0_b)
val tmp_0: Int = reordered1()
val tmp_1: Int = reordered2()
foo(a = tmp_1, b = tmp_0)
}
{ // BLOCK
val tmp2_a: Int = reordered2()
foo(a = tmp2_a, b = 1)
val tmp_2: Int = reordered2()
foo(a = tmp_2, b = 1)
}
}
@@ -45,37 +45,37 @@ fun withVararg(vararg xs: Int): Int {
fun test1() {
{ // BLOCK
val <array>: A = A
val <index_0>: Function1<Int, Unit> = { // BLOCK
val tmp_0: A = A
val tmp_1: Function1<Int, Unit> = { // BLOCK
local fun withVararg(p0: Int) {
withVararg(xs = [p0])
}
::withVararg
}
<array>.set(i = <index_0> /*-> IFoo */, newValue = <array>.get(i = <index_0> /*-> IFoo */).plus(other = 1))
tmp_0.set(i = tmp_1 /*-> IFoo */, newValue = tmp_0.get(i = tmp_1 /*-> IFoo */).plus(other = 1))
}
}
fun test2() {
{ // BLOCK
val <array>: B = B
val <index_0>: Function1<Int, Unit> = { // BLOCK
val tmp_2: B = B
val tmp_3: Function1<Int, Unit> = { // BLOCK
local fun withVararg(p0: Int) {
withVararg(xs = [p0])
}
::withVararg
}
<array>.set(i = <index_0> /*-> IFoo2 */, newValue = <array>.get(i = <index_0> /*-> IFoo */).plus(other = 1))
tmp_2.set(i = tmp_3 /*-> IFoo2 */, newValue = tmp_2.get(i = tmp_3 /*-> IFoo */).plus(other = 1))
}
}
fun test3(fn: Function1<Int, Unit>) {
{ // BLOCK
val <array>: A = A
val <index_0>: Function1<Int, Unit> = fn
<array>.set(i = <index_0> /*-> IFoo */, newValue = <array>.get(i = <index_0> /*-> IFoo */).plus(other = 1))
val tmp_4: A = A
val tmp_5: Function1<Int, Unit> = fn
tmp_4.set(i = tmp_5 /*-> IFoo */, newValue = tmp_4.get(i = tmp_5 /*-> IFoo */).plus(other = 1))
}
}
@@ -83,9 +83,9 @@ fun test4(fn: Function1<Int, Unit>) {
when {
fn is IFoo -> { // BLOCK
{ // BLOCK
val <array>: A = A
val <index_0>: IFoo = fn /*as IFoo */
<array>.set(i = <index_0>, newValue = <array>.get(i = <index_0>).plus(other = 1))
val tmp_6: A = A
val tmp_7: IFoo = fn /*as IFoo */
tmp_6.set(i = tmp_7, newValue = tmp_6.get(i = tmp_7).plus(other = 1))
}
}
}
@@ -94,9 +94,9 @@ fun test4(fn: Function1<Int, Unit>) {
fun test5(a: Any) {
a as Function1<Int, Unit> /*~> Unit */
{ // BLOCK
val <array>: A = A
val <index_0>: Function1<Int, Unit> = a /*as Function1<Int, Unit> */
<array>.set(i = <index_0> /*-> IFoo */, newValue = <array>.get(i = <index_0> /*-> IFoo */).plus(other = 1))
val tmp_8: A = A
val tmp_9: Function1<Int, Unit> = a /*as Function1<Int, Unit> */
tmp_8.set(i = tmp_9 /*-> IFoo */, newValue = tmp_8.get(i = tmp_9 /*-> IFoo */).plus(other = 1))
}
}
@@ -104,9 +104,9 @@ fun test6(a: Any) {
a as Function1<Int, Unit> /*~> Unit */
a /*as Function1<Int, Unit> */ as IFoo /*~> Unit */
{ // BLOCK
val <array>: A = A
val <index_0>: Function1<Int, Unit> = a /*as Function1<Int, Unit> */
<array>.set(i = <index_0>, newValue = <array>.get(i = <index_0>).plus(other = 1))
val tmp_10: A = A
val tmp_11: Function1<Int, Unit> = a /*as Function1<Int, Unit> */
tmp_10.set(i = tmp_11, newValue = tmp_10.get(i = tmp_11).plus(other = 1))
}
}
@@ -45,37 +45,37 @@ fun withVararg(vararg xs: Int): Int {
fun test1() {
{ // BLOCK
val tmp0_array: A = A
val tmp2_sam: IFoo = { // BLOCK
val tmp_0: A = A
val tmp_1: IFoo = { // BLOCK
local fun withVararg(p0: Int) {
withVararg(xs = [p0]) /*~> Unit */
}
::withVararg
} /*-> IFoo */
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
tmp_0.set(i = tmp_1, newValue = tmp_0.get(i = tmp_1).plus(other = 1))
}
}
fun test2() {
{ // BLOCK
val tmp0_array: B = B
val tmp2_sam: IFoo2 = { // BLOCK
val tmp_2: B = B
val tmp_3: IFoo2 = { // BLOCK
local fun withVararg(p0: Int) {
withVararg(xs = [p0]) /*~> Unit */
}
::withVararg
} /*-> IFoo2 */
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
tmp_2.set(i = tmp_3, newValue = tmp_2.get(i = tmp_3).plus(other = 1))
}
}
fun test3(fn: Function1<Int, Unit>) {
{ // BLOCK
val tmp0_array: A = A
val tmp2_sam: IFoo = fn /*-> IFoo */
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
val tmp_4: A = A
val tmp_5: IFoo = fn /*-> IFoo */
tmp_4.set(i = tmp_5, newValue = tmp_4.get(i = tmp_5).plus(other = 1))
}
}
@@ -83,9 +83,9 @@ fun test4(fn: Function1<Int, Unit>) {
when {
fn is IFoo -> { // BLOCK
{ // BLOCK
val tmp0_array: A = A
val tmp1_index0: Function1<Int, Unit> = fn
tmp0_array.set(i = tmp1_index0 /*as IFoo */, newValue = tmp0_array.get(i = tmp1_index0 /*as IFoo */).plus(other = 1))
val tmp_6: A = A
val tmp_7: Function1<Int, Unit> = fn
tmp_6.set(i = tmp_7 /*as IFoo */, newValue = tmp_6.get(i = tmp_7 /*as IFoo */).plus(other = 1))
}
}
}
@@ -94,9 +94,9 @@ fun test4(fn: Function1<Int, Unit>) {
fun test5(a: Any) {
a as Function1<Int, Unit> /*~> Unit */
{ // BLOCK
val tmp0_array: A = A
val tmp2_sam: IFoo = a /*as Function1<Int, Unit> */ /*-> IFoo */
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
val tmp_8: A = A
val tmp_9: IFoo = a /*as Function1<Int, Unit> */ /*-> IFoo */
tmp_8.set(i = tmp_9, newValue = tmp_8.get(i = tmp_9).plus(other = 1))
}
}
@@ -104,8 +104,8 @@ fun test6(a: Any) {
a as Function1<Int, Unit> /*~> Unit */
a as IFoo /*~> Unit */
{ // BLOCK
val tmp0_array: A = A
val tmp1_index0: Any = a
tmp0_array.set(i = tmp1_index0 /*as IFoo */, newValue = tmp0_array.get(i = tmp1_index0 /*as IFoo */).plus(other = 1))
val tmp_10: A = A
val tmp_11: Any = a
tmp_10.set(i = tmp_11 /*as IFoo */, newValue = tmp_10.get(i = tmp_11 /*as IFoo */).plus(other = 1))
}
}
@@ -1,9 +1,9 @@
fun sum(vararg args: Int): Int {
var result: Int = 0
{ // BLOCK
val <iterator>: IntIterator = args.iterator()
while (<iterator>.hasNext()) { // BLOCK
val arg: Int = <iterator>.next()
val tmp_0: IntIterator = args.iterator()
while (tmp_0.hasNext()) { // BLOCK
val arg: Int = tmp_0.next()
{ // BLOCK
result = result.plus(other = arg)
}
@@ -1,9 +1,9 @@
fun sum(vararg args: Int): Int {
var result: Int = 0
{ // BLOCK
val tmp0_iterator: IntIterator = args.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val arg: Int = tmp0_iterator.next()
val tmp_0: IntIterator = args.iterator()
while (tmp_0.hasNext()) { // BLOCK
val arg: Int = tmp_0.next()
result = result.plus(other = arg)
}
}
@@ -17,28 +17,28 @@ class C {
fun test(nc: C?): C? {
return { // BLOCK
val tmp3_safe_receiver: C? = { // BLOCK
val tmp2_safe_receiver: C? = { // BLOCK
val tmp1_safe_receiver: C? = { // BLOCK
val tmp0_safe_receiver: C? = nc
val tmp_0: C? = { // BLOCK
val tmp_1: C? = { // BLOCK
val tmp_2: C? = { // BLOCK
val tmp_3: C? = nc
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.foo()
EQEQ(arg0 = tmp_3, arg1 = null) -> null
else -> tmp_3.foo()
}
}
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.bar()
EQEQ(arg0 = tmp_2, arg1 = null) -> null
else -> tmp_2.bar()
}
}
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
else -> tmp2_safe_receiver.foo()
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.foo()
}
}
when {
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null
else -> tmp3_safe_receiver.foo()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.foo()
}
}
}
@@ -11,17 +11,17 @@ fun test2(mc: MutableCollection<String>) {
fun test3() {
{ // BLOCK
val tmp0_safe_receiver: @FlexibleNullability PrintStream? = #out
val tmp_0: @FlexibleNullability PrintStream? = #out
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.println(p0 = "Hello,")
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.println(p0 = "Hello,")
}
} /*~> Unit */
{ // BLOCK
val tmp1_safe_receiver: @FlexibleNullability PrintStream? = #out
val tmp_1: @FlexibleNullability PrintStream? = #out
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.println(p0 = "world!")
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.println(p0 = "world!")
}
} /*~> Unit */
}
@@ -11,17 +11,17 @@ fun test2(mc: MutableCollection<String>) {
fun test3() {
{ // BLOCK
val tmp0_safe_receiver: @FlexibleNullability PrintStream? = super<System>.#out
val tmp_0: @FlexibleNullability PrintStream? = super<System>.#out
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*!! PrintStream */.println(p0 = "Hello,")
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0 /*!! PrintStream */.println(p0 = "Hello,")
}
} /*~> Unit */
{ // BLOCK
val tmp1_safe_receiver: @FlexibleNullability PrintStream? = super<System>.#out
val tmp_1: @FlexibleNullability PrintStream? = super<System>.#out
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*!! PrintStream */.println(p0 = "world!")
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1 /*!! PrintStream */.println(p0 = "world!")
}
} /*~> Unit */
}
@@ -42,32 +42,32 @@ object X1 {
fun test1(a: IntArray) {
var i: Int = 0
val <array>: IntArray = a
val <index_0>: Int = { // BLOCK
val <unary>: Int = i
i = <unary>.inc()
<unary>
val tmp_0: IntArray = a
val tmp_1: Int = { // BLOCK
val tmp_2: Int = i
i = tmp_2.inc()
tmp_2
}
val <unary>: Int = <array>.get(index = <index_0>)
<array>.set(index = <index_0>, value = <unary>.inc())
<unary> /*~> Unit */
val tmp_3: Int = tmp_0.get(index = tmp_1)
tmp_0.set(index = tmp_1, value = tmp_3.inc())
tmp_3 /*~> Unit */
}
fun test2() {
{ // BLOCK
val <unary>: Int = X1.<get-x1>()
X1.<set-x1>(<set-?> = <unary>.inc())
<unary>
val tmp_4: Int = X1.<get-x1>()
X1.<set-x1>(<set-?> = tmp_4.inc())
tmp_4
} /*~> Unit */
{ // BLOCK
val <unary>: Int = X2.<get-x2>()
X2.<set-x2>(<set-?> = <unary>.inc())
<unary>
val tmp_5: Int = X2.<get-x2>()
X2.<set-x2>(<set-?> = tmp_5.inc())
tmp_5
} /*~> Unit */
{ // BLOCK
val <unary>: Int = X3.<get-x3>()
X3.<set-x3>(<set-?> = <unary>.inc())
<unary>
val tmp_6: Int = X3.<get-x3>()
X3.<set-x3>(<set-?> = tmp_6.inc())
tmp_6
} /*~> Unit */
}
@@ -43,41 +43,41 @@ object X1 {
fun test1(a: IntArray) {
var i: Int = 0
{ // BLOCK
val tmp1_array: IntArray = a
val tmp2_index0: Int = { // BLOCK
val tmp0: Int = i
i = tmp0.inc()
tmp0
val tmp_0: IntArray = a
val tmp_1: Int = { // BLOCK
val tmp_2: Int = i
i = tmp_2.inc()
tmp_2
}
val tmp3: Int = tmp1_array.get(index = tmp2_index0)
tmp1_array.set(index = tmp2_index0, value = tmp3.inc())
tmp3
val tmp_3: Int = tmp_0.get(index = tmp_1)
tmp_0.set(index = tmp_1, value = tmp_3.inc())
tmp_3
} /*~> Unit */
}
fun test2() {
{ // BLOCK
val tmp0_this: X1 = X1
val tmp_4: X1 = X1
{ // BLOCK
val tmp1: Int = tmp0_this.<get-x1>()
tmp0_this.<set-x1>(<set-?> = tmp1.inc())
tmp1
val tmp_5: Int = tmp_4.<get-x1>()
tmp_4.<set-x1>(<set-?> = tmp_5.inc())
tmp_5
}
} /*~> Unit */
{ // BLOCK
val tmp2_this: X2 = X2
val tmp_6: X2 = X2
{ // BLOCK
val tmp3: Int = tmp2_this.<get-x2>()
tmp2_this.<set-x2>(<set-?> = tmp3.inc())
tmp3
val tmp_7: Int = tmp_6.<get-x2>()
tmp_6.<set-x2>(<set-?> = tmp_7.inc())
tmp_7
}
} /*~> Unit */
{ // BLOCK
val tmp4_this: X3 = X3
val tmp_8: X3 = X3
{ // BLOCK
val tmp5: Int = tmp4_this.<get-x3>()
tmp4_this.<set-x3>(<set-?> = tmp5.inc())
tmp5
val tmp_9: Int = tmp_8.<get-x3>()
tmp_8.<set-x3>(<set-?> = tmp_9.inc())
tmp_9
}
} /*~> Unit */
}
@@ -105,8 +105,8 @@ object Host {
operator fun B.plusAssign(b: B) {
{ // BLOCK
val tmp0_this: B = <this>
tmp0_this.<set-s>(<set-?> = tmp0_this.<get-s>().plus(other = b.<get-s>()))
val tmp_10: B = <this>
tmp_10.<set-s>(<set-?> = tmp_10.<get-s>().plus(other = b.<get-s>()))
}
}
@@ -25,7 +25,7 @@ object B {
}
fun B.test() {
val <destruct>: A = A
val x: Int = (<this>, <destruct>).component1()
val y: Int = (<this>, <destruct>).component2()
val tmp_0: A = A
val x: Int = (<this>, tmp_0).component1()
val y: Int = (<this>, tmp_0).component2()
}
@@ -26,8 +26,8 @@ object B {
fun B.test() {
// COMPOSITE {
val tmp0_container: A = A
val x: Int = (<this>, tmp0_container).component1()
val y: Int = (<this>, tmp0_container).component2()
val tmp_0: A = A
val x: Int = (<this>, tmp_0).component1()
val y: Int = (<this>, tmp_0).component2()
// }
}
@@ -29,7 +29,7 @@ object B {
}
fun B.test() {
val <destruct>: A = A
val x: Int = (<this>, <destruct>).component1()
val z: Int = (<this>, <destruct>).component3()
val tmp_0: A = A
val x: Int = (<this>, tmp_0).component1()
val z: Int = (<this>, tmp_0).component3()
}
@@ -30,8 +30,8 @@ object B {
fun B.test() {
// COMPOSITE {
val tmp0_container: A = A
val x: Int = (<this>, tmp0_container).component1()
val z: Int = (<this>, tmp0_container).component3()
val tmp_0: A = A
val x: Int = (<this>, tmp_0).component1()
val z: Int = (<this>, tmp_0).component3()
// }
}
@@ -4,10 +4,10 @@ fun length(s: String): Int {
fun lengthN(s: String?): Int? {
return { // BLOCK
val tmp0_safe_receiver: String? = s
val tmp_0: String? = s
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.<get-length>()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.<get-length>()
}
}
}
-111
View File
@@ -1,111 +0,0 @@
FILE fqName:<root> fileName:/elvis.kt
PROPERTY name:p visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Any? visibility:private [final,static]
EXPRESSION_BODY
CONST Null type=kotlin.Nothing? value=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-p> visibility:public modality:FINAL <> () returnType:kotlin.Any?
correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-p> (): kotlin.Any? declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any?
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any? declared in <root>'
CONST Null type=kotlin.Nothing? value=null
FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Any?, b:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:a index:0 type:kotlin.Any?
VALUE_PARAMETER name:b index:1 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Any?, b: kotlin.Any): kotlin.Any declared in <root>'
BLOCK type=kotlin.Any origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val]
GET_VAR 'a: kotlin.Any? declared in <root>.test1' type=kotlin.Any? origin=null
WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_0: kotlin.Any? declared in <root>.test1' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: GET_VAR 'b: kotlin.Any declared in <root>.test1' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_0: kotlin.Any? declared in <root>.test1' type=kotlin.Any? origin=null
FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String?, b:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:a index:0 type:kotlin.String?
VALUE_PARAMETER name:b index:1 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.String?, b: kotlin.Any): kotlin.Any declared in <root>'
BLOCK type=kotlin.Any origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val]
GET_VAR 'a: kotlin.String? declared in <root>.test2' type=kotlin.String? origin=null
WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_1: kotlin.String? declared in <root>.test2' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: GET_VAR 'b: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_1: kotlin.String? declared in <root>.test2' type=kotlin.String? origin=null
FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Any?, b:kotlin.Any?) returnType:kotlin.String
VALUE_PARAMETER name:a index:0 type:kotlin.Any?
VALUE_PARAMETER name:b index:1 type:kotlin.Any?
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'b: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in <root>'
CONST String type=kotlin.String value=""
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String?
GET_VAR 'a: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in <root>'
CONST String type=kotlin.String value=""
RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in <root>'
BLOCK type=kotlin.String origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val]
TYPE_OP type=kotlin.String? origin=IMPLICIT_CAST typeOperand=kotlin.String?
GET_VAR 'a: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
WHEN type=kotlin.String origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_2: kotlin.String? declared in <root>.test3' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'b: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_2: kotlin.String? declared in <root>.test3' type=kotlin.String? origin=null
FUN name:test4 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4 (x: kotlin.Any): kotlin.Any declared in <root>'
BLOCK type=kotlin.Any origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Any? [val]
CALL 'public final fun <get-p> (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=GET_PROPERTY
WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_3: kotlin.Any? declared in <root>.test4' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: GET_VAR 'x: kotlin.Any declared in <root>.test4' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_3: kotlin.Any? declared in <root>.test4' type=kotlin.Any? origin=null
FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Any): kotlin.Any declared in <root>'
BLOCK type=kotlin.Any origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Any? [val]
CALL 'public final fun foo (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=null
WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_4: kotlin.Any? declared in <root>.test5' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: GET_VAR 'x: kotlin.Any declared in <root>.test5' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_4: kotlin.Any? declared in <root>.test5' type=kotlin.Any? origin=null
@@ -1,63 +0,0 @@
val p: Any?
field = null
get
fun foo(): Any? {
return null
}
fun test1(a: Any?, b: Any): Any {
return { // BLOCK
val <elvis>: Any? = a
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> b
else -> <elvis>
}
}
}
fun test2(a: String?, b: Any): Any {
return { // BLOCK
val <elvis>: String? = a
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> b
else -> <elvis>
}
}
}
fun test3(a: Any?, b: Any?): String {
when {
b !is String -> return ""
}
when {
a !is String? -> return ""
}
return { // BLOCK
val <elvis>: String? = a /*as String? */
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> b /*as String */
else -> <elvis>
}
}
}
fun test4(x: Any): Any {
return { // BLOCK
val <elvis>: Any? = <get-p>()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> x
else -> <elvis>
}
}
}
fun test5(x: Any): Any {
return { // BLOCK
val <elvis>: Any? = foo()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> x
else -> <elvis>
}
}
}
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
val p: Any? = null
fun foo(): Any? = null
+15 -15
View File
@@ -8,20 +8,20 @@ fun foo(): Any? {
fun test1(a: Any?, b: Any): Any {
return { // BLOCK
val tmp0_elvis_lhs: Any? = a
val tmp_0: Any? = a
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> b
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_0, arg1 = null) -> b
else -> tmp_0
}
}
}
fun test2(a: String?, b: Any): Any {
return { // BLOCK
val tmp0_elvis_lhs: String? = a
val tmp_1: String? = a
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> b
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_1, arg1 = null) -> b
else -> tmp_1
}
}
}
@@ -34,30 +34,30 @@ fun test3(a: Any?, b: Any?): String {
a !is String? -> return ""
}
return { // BLOCK
val tmp0_elvis_lhs: String? = a /*as String? */
val tmp_2: String? = a /*as String? */
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> b /*as String */
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_2, arg1 = null) -> b /*as String */
else -> tmp_2
}
}
}
fun test4(x: Any): Any {
return { // BLOCK
val tmp0_elvis_lhs: Any? = <get-p>()
val tmp_3: Any? = <get-p>()
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> x
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_3, arg1 = null) -> x
else -> tmp_3
}
}
}
fun test5(x: Any): Any {
return { // BLOCK
val tmp0_elvis_lhs: Any? = foo()
val tmp_4: Any? = foo()
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> x
else -> tmp0_elvis_lhs
EQEQ(arg0 = tmp_4, arg1 = null) -> x
else -> tmp_4
}
}
}
@@ -19,9 +19,9 @@ enum class A : Enum<A> {
fun testVariableAssignment_throws(a: A) {
val x: Int
{ // BLOCK
val tmp0_subject: A = a
val tmp_0: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> { // BLOCK
EQEQ(arg0 = tmp_0, arg1 = A.V1) -> { // BLOCK
x = 11
}
else -> noWhenBranchMatchedException()
@@ -31,9 +31,9 @@ fun testVariableAssignment_throws(a: A) {
fun testStatement_empty(a: A) {
{ // BLOCK
val tmp1_subject: A = a
val tmp_1: A = a
when {
EQEQ(arg0 = tmp1_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_1, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
} /*~> Unit */
@@ -41,9 +41,9 @@ fun testStatement_empty(a: A) {
fun testParenthesized_throwsJvm(a: A) {
{ // BLOCK
val tmp2_subject: A = a
val tmp_2: A = a
when {
EQEQ(arg0 = tmp2_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_2, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
} /*~> Unit */
@@ -51,9 +51,9 @@ fun testParenthesized_throwsJvm(a: A) {
fun testAnnotated_throwsJvm(a: A) {
{ // BLOCK
val tmp3_subject: A = a
val tmp_3: A = a
when {
EQEQ(arg0 = tmp3_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_3, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
} /*~> Unit */
@@ -61,9 +61,9 @@ fun testAnnotated_throwsJvm(a: A) {
fun testExpression_throws(a: A): Int {
return { // BLOCK
val tmp4_subject: A = a
val tmp_4: A = a
when {
EQEQ(arg0 = tmp4_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_4, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -74,9 +74,9 @@ fun testIfTheElseStatement_empty(a: A, flag: Boolean) {
flag -> 0
else -> { // BLOCK
{ // BLOCK
val tmp5_subject: A = a
val tmp_5: A = a
when {
EQEQ(arg0 = tmp5_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_5, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -89,9 +89,9 @@ fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean) {
flag -> 0
else -> { // BLOCK
{ // BLOCK
val tmp6_subject: A = a
val tmp_6: A = a
when {
EQEQ(arg0 = tmp6_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_6, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -104,9 +104,9 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) {
flag -> 0
else -> { // BLOCK
{ // BLOCK
val tmp7_subject: A = a
val tmp_7: A = a
when {
EQEQ(arg0 = tmp7_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_7, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -117,9 +117,9 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) {
fun testLambdaResultExpression_throws(a: A) {
local fun <anonymous>(): Int {
return { // BLOCK
val tmp8_subject: A = a
val tmp_8: A = a
when {
EQEQ(arg0 = tmp8_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_8, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -19,9 +19,9 @@ enum class A : Enum<A> {
fun testVariableAssignment_throws(a: A) {
val x: Int
{ // BLOCK
val tmp0_subject: A = a
val tmp_0: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> x = 11
EQEQ(arg0 = tmp_0, arg1 = A.V1) -> x = 11
else -> noWhenBranchMatchedException()
}
}
@@ -29,36 +29,36 @@ fun testVariableAssignment_throws(a: A) {
fun testStatement_empty(a: A) {
{ // BLOCK
val tmp0_subject: A = a
val tmp_1: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
EQEQ(arg0 = tmp_1, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
fun testParenthesized_throwsJvm(a: A) {
{ // BLOCK
val tmp0_subject: A = a
val tmp_2: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
EQEQ(arg0 = tmp_2, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
fun testAnnotated_throwsJvm(a: A) {
{ // BLOCK
val tmp0_subject: A = a
val tmp_3: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
EQEQ(arg0 = tmp_3, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
fun testExpression_throws(a: A): Int {
return { // BLOCK
val tmp0_subject: A = a
val tmp_4: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_4, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -69,9 +69,9 @@ fun testIfTheElseStatement_empty(a: A, flag: Boolean) {
flag -> 0 /*~> Unit */
else -> { // BLOCK
{ // BLOCK
val tmp0_subject: A = a
val tmp_5: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
EQEQ(arg0 = tmp_5, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
@@ -83,9 +83,9 @@ fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean) {
flag -> 0 /*~> Unit */
else -> { // BLOCK
{ // BLOCK
val tmp0_subject: A = a
val tmp_6: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
EQEQ(arg0 = tmp_6, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
@@ -97,9 +97,9 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) {
flag -> 0 /*~> Unit */
else -> { // BLOCK
{ // BLOCK
val tmp0_subject: A = a
val tmp_7: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
EQEQ(arg0 = tmp_7, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
@@ -109,9 +109,9 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) {
fun testLambdaResultExpression_throws(a: A) {
local fun <anonymous>(): Int {
return { // BLOCK
val tmp0_subject: A = a
val tmp_8: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1
EQEQ(arg0 = tmp_8, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
@@ -1,9 +1,9 @@
fun test(receiver: Any?, fn: @ExtensionFunctionType Function3<Any, Int, String, Unit>): Unit? {
return { // BLOCK
val tmp0_safe_receiver: Any? = receiver
val tmp_0: Any? = receiver
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> fn.invoke(p1 = tmp0_safe_receiver, p2 = 42, p3 = "Hello")
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> fn.invoke(p1 = tmp_0, p2 = 42, p3 = "Hello")
}
}
}
@@ -5,10 +5,10 @@ fun testDD(x: Double?, y: Double?): Boolean {
fun testDF(x: Double?, y: Any?): Boolean {
return when {
y is Float? -> ieee754equals(arg0 = x, arg1 = { // BLOCK
val tmp0_safe_receiver: Float? = y /*as Float? */
val tmp_0: Float? = y /*as Float? */
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.toDouble()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.toDouble()
}
})
else -> false
@@ -18,10 +18,10 @@ fun testDF(x: Double?, y: Any?): Boolean {
fun testDI(x: Double?, y: Any?): Boolean {
return when {
y is Int? -> ieee754equals(arg0 = x, arg1 = { // BLOCK
val tmp1_safe_receiver: Int? = y /*as Int? */
val tmp_1: Int? = y /*as Int? */
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.toDouble()
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.toDouble()
}
})
else -> false
@@ -34,10 +34,10 @@ fun testDI2(x: Any?, y: Any?): Boolean {
x is Int? -> y is Double
else -> false
} -> ieee754equals(arg0 = { // BLOCK
val tmp2_safe_receiver: Int? = x /*as Int? */
val tmp_2: Int? = x /*as Int? */
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
else -> tmp2_safe_receiver.toDouble()
EQEQ(arg0 = tmp_2, arg1 = null) -> null
else -> tmp_2.toDouble()
}
}, arg1 = y /*as Double? */)
else -> false
@@ -5,10 +5,10 @@ fun testDD(x: Double?, y: Double?): Boolean {
fun testDF(x: Double?, y: Any?): Boolean {
return when {
y is Float? -> ieee754equals(arg0 = x, arg1 = { // BLOCK
val tmp0_safe_receiver: Any? = y
val tmp_0: Any? = y
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Float */.toDouble()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0 /*as Float */.toDouble()
}
})
else -> false
@@ -18,10 +18,10 @@ fun testDF(x: Double?, y: Any?): Boolean {
fun testDI(x: Double?, y: Any?): Boolean {
return when {
y is Int? -> ieee754equals(arg0 = x, arg1 = { // BLOCK
val tmp0_safe_receiver: Any? = y
val tmp_1: Any? = y
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Int */.toDouble()
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1 /*as Int */.toDouble()
}
})
else -> false
@@ -34,10 +34,10 @@ fun testDI2(x: Any?, y: Any?): Boolean {
x is Int? -> y is Double
else -> false
} -> ieee754equals(arg0 = { // BLOCK
val tmp0_safe_receiver: Any? = x
val tmp_2: Any? = x
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Int */.toDouble()
EQEQ(arg0 = tmp_2, arg1 = null) -> null
else -> tmp_2 /*as Int */.toDouble()
}
}, arg1 = y /*as Double? */)
else -> false
@@ -1,8 +1,8 @@
fun testSimple(x: Double): Int {
return { // BLOCK
val tmp0_subject: Double = x
val tmp_0: Double = x
when {
ieee754equals(arg0 = tmp0_subject, arg1 = 0.0) -> 0
ieee754equals(arg0 = tmp_0, arg1 = 0.0) -> 0
else -> 1
}
}
@@ -13,9 +13,9 @@ fun testSmartCastInWhenSubject(x: Any): Int {
x !is Double -> return -1
}
return { // BLOCK
val tmp1_subject: Double = x /*as Double */
val tmp_1: Double = x /*as Double */
when {
ieee754equals(arg0 = tmp1_subject, arg1 = 0.0) -> 0
ieee754equals(arg0 = tmp_1, arg1 = 0.0) -> 0
else -> 1
}
}
@@ -26,9 +26,9 @@ fun testSmartCastInWhenCondition(x: Double, y: Any): Int {
y !is Double -> return -1
}
return { // BLOCK
val tmp2_subject: Double = x
val tmp_2: Double = x
when {
ieee754equals(arg0 = tmp2_subject, arg1 = y /*as Double */) -> 0
ieee754equals(arg0 = tmp_2, arg1 = y /*as Double */) -> 0
else -> 1
}
}
@@ -36,10 +36,10 @@ fun testSmartCastInWhenCondition(x: Double, y: Any): Int {
fun testSmartCastInWhenConditionInBranch(x: Any): Int {
return { // BLOCK
val tmp3_subject: Any = x
val tmp_3: Any = x
when {
tmp3_subject !is Double -> -1
ieee754equals(arg0 = tmp3_subject /*as Double */, arg1 = 0.0) -> 0
tmp_3 !is Double -> -1
ieee754equals(arg0 = tmp_3 /*as Double */, arg1 = 0.0) -> 0
else -> 1
}
}
@@ -53,9 +53,9 @@ fun testSmartCastToDifferentTypes(x: Any, y: Any): Int {
y !is Float -> return -1
}
return { // BLOCK
val tmp4_subject: Double = x /*as Double */
val tmp_4: Double = x /*as Double */
when {
ieee754equals(arg0 = tmp4_subject, arg1 = y /*as Float */.toDouble()) -> 0
ieee754equals(arg0 = tmp_4, arg1 = y /*as Float */.toDouble()) -> 0
else -> 1
}
}
@@ -67,9 +67,9 @@ fun foo(x: Double): Double {
fun testWithPrematureExitInConditionSubexpression(x: Any): Int {
return { // BLOCK
val tmp5_subject: Any = x
val tmp_5: Any = x
when {
EQEQ(arg0 = tmp5_subject, arg1 = foo(x = when {
EQEQ(arg0 = tmp_5, arg1 = foo(x = when {
x !is Double -> return 42
else -> x /*as Double */
})) -> 0
@@ -1,8 +1,8 @@
fun testSimple(x: Double): Int {
return { // BLOCK
val tmp0_subject: Double = x
val tmp_0: Double = x
when {
ieee754equals(arg0 = tmp0_subject, arg1 = 0.0) -> 0
ieee754equals(arg0 = tmp_0, arg1 = 0.0) -> 0
else -> 1
}
}
@@ -13,9 +13,9 @@ fun testSmartCastInWhenSubject(x: Any): Int {
x !is Double -> return -1
}
return { // BLOCK
val tmp0_subject: Any = x
val tmp_1: Any = x
when {
ieee754equals(arg0 = tmp0_subject /*as Double */, arg1 = 0.0) -> 0
ieee754equals(arg0 = tmp_1 /*as Double */, arg1 = 0.0) -> 0
else -> 1
}
}
@@ -26,9 +26,9 @@ fun testSmartCastInWhenCondition(x: Double, y: Any): Int {
y !is Double -> return -1
}
return { // BLOCK
val tmp0_subject: Double = x
val tmp_2: Double = x
when {
ieee754equals(arg0 = tmp0_subject, arg1 = y /*as Double */) -> 0
ieee754equals(arg0 = tmp_2, arg1 = y /*as Double */) -> 0
else -> 1
}
}
@@ -36,10 +36,10 @@ fun testSmartCastInWhenCondition(x: Double, y: Any): Int {
fun testSmartCastInWhenConditionInBranch(x: Any): Int {
return { // BLOCK
val tmp0_subject: Any = x
val tmp_3: Any = x
when {
tmp0_subject is Double.not() -> -1
ieee754equals(arg0 = tmp0_subject /*as Double */, arg1 = 0.0) -> 0
tmp_3 is Double.not() -> -1
ieee754equals(arg0 = tmp_3 /*as Double */, arg1 = 0.0) -> 0
else -> 1
}
}
@@ -53,9 +53,9 @@ fun testSmartCastToDifferentTypes(x: Any, y: Any): Int {
y !is Float -> return -1
}
return { // BLOCK
val tmp0_subject: Any = x
val tmp_4: Any = x
when {
ieee754equals(arg0 = tmp0_subject /*as Double */, arg1 = y /*as Float */.toDouble()) -> 0
ieee754equals(arg0 = tmp_4 /*as Double */, arg1 = y /*as Float */.toDouble()) -> 0
else -> 1
}
}
@@ -67,9 +67,9 @@ fun foo(x: Double): Double {
fun testWithPrematureExitInConditionSubexpression(x: Any): Int {
return { // BLOCK
val tmp0_subject: Any = x
val tmp_5: Any = x
when {
EQEQ(arg0 = tmp0_subject, arg1 = foo(x = when {
EQEQ(arg0 = tmp_5, arg1 = foo(x = when {
x !is Double -> return 42
else -> x /*as Double */
})) -> 0
-72
View File
@@ -1,72 +0,0 @@
FILE fqName:<root> fileName:/for.kt
FUN name:testEmpty visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator<kotlin.String> [val]
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=FOR_LOOP_ITERATOR
$this: GET_VAR 'ss: kotlin.collections.List<kotlin.String> declared in <root>.testEmpty' type=kotlin.collections.List<kotlin.String> origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.String> declared in <root>.testEmpty' type=kotlin.collections.Iterator<kotlin.String> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val]
CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.String> declared in <root>.testEmpty' type=kotlin.collections.Iterator<kotlin.String> origin=null
FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator<kotlin.String> [val]
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=FOR_LOOP_ITERATOR
$this: GET_VAR 'ss: kotlin.collections.List<kotlin.String> declared in <root>.testIterable' type=kotlin.collections.List<kotlin.String> origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<kotlin.String> declared in <root>.testIterable' type=kotlin.collections.Iterator<kotlin.String> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val]
CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<kotlin.String> declared in <root>.testIterable' type=kotlin.collections.Iterator<kotlin.String> origin=null
BLOCK type=kotlin.Unit origin=null
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null
message: GET_VAR 'val s: kotlin.String declared in <root>.testIterable' type=kotlin.String origin=null
FUN name:testDestructuring visibility:public modality:FINAL <> (pp:kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>>) returnType:kotlin.Unit
VALUE_PARAMETER name:pp index:0 type:kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>>
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> [val]
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=FOR_LOOP_ITERATOR
$this: GET_VAR 'pp: kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>> declared in <root>.testDestructuring' type=kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Pair<kotlin.Int, kotlin.String> [val]
CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
VAR name:i type:kotlin.Int [val]
CALL 'public final fun component1 (): A of kotlin.Pair declared in kotlin.Pair' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: GET_VAR 'val tmp_3: kotlin.Pair<kotlin.Int, kotlin.String> declared in <root>.testDestructuring' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=null
VAR name:s type:kotlin.String [val]
CALL 'public final fun component2 (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.String origin=COMPONENT_N(index=2)
$this: GET_VAR 'val tmp_3: kotlin.Pair<kotlin.Int, kotlin.String> declared in <root>.testDestructuring' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=null
BLOCK type=kotlin.Unit origin=null
CALL 'public final fun println (message: kotlin.Int): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null
message: GET_VAR 'val i: kotlin.Int declared in <root>.testDestructuring' type=kotlin.Int origin=null
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null
message: GET_VAR 'val s: kotlin.String declared in <root>.testDestructuring' type=kotlin.String origin=null
FUN name:testRange visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.IntIterator [val]
CALL 'public open fun iterator (): kotlin.collections.IntIterator declared in kotlin.ranges.IntRange' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
$this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=10
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_4: kotlin.collections.IntIterator declared in <root>.testRange' type=kotlin.collections.IntIterator origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:i type:kotlin.Int [val]
CALL 'public final fun next (): kotlin.Int declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_4: kotlin.collections.IntIterator declared in <root>.testRange' type=kotlin.collections.IntIterator origin=null
-45
View File
@@ -1,45 +0,0 @@
fun testEmpty(ss: List<String>) {
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
while (<iterator>.hasNext()) { // BLOCK
val s: String = <iterator>.next()
}
}
}
fun testIterable(ss: List<String>) {
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
while (<iterator>.hasNext()) { // BLOCK
val s: String = <iterator>.next()
{ // BLOCK
println(message = s)
}
}
}
}
fun testDestructuring(pp: List<Pair<Int, String>>) {
{ // BLOCK
val <iterator>: Iterator<Pair<Int, String>> = pp.iterator()
while (<iterator>.hasNext()) { // BLOCK
val <destruct>: Pair<Int, String> = <iterator>.next()
val i: Int = <destruct>.component1()
val s: String = <destruct>.component2()
{ // BLOCK
println(message = i)
println(message = s)
}
}
}
}
fun testRange() {
{ // BLOCK
val <iterator>: IntIterator = 1.rangeTo(other = 10).iterator()
while (<iterator>.hasNext()) { // BLOCK
val i: Int = <iterator>.next()
}
}
}
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// WITH_STDLIB
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
+14 -14
View File
@@ -1,17 +1,17 @@
fun testEmpty(ss: List<String>) {
{ // BLOCK
val tmp0_iterator: Iterator<String> = ss.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val s: String = tmp0_iterator.next()
val tmp_0: Iterator<String> = ss.iterator()
while (tmp_0.hasNext()) { // BLOCK
val s: String = tmp_0.next()
}
}
}
fun testIterable(ss: List<String>) {
{ // BLOCK
val tmp0_iterator: Iterator<String> = ss.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val s: String = tmp0_iterator.next()
val tmp_1: Iterator<String> = ss.iterator()
while (tmp_1.hasNext()) { // BLOCK
val s: String = tmp_1.next()
{ // BLOCK
println(message = s)
}
@@ -21,11 +21,11 @@ fun testIterable(ss: List<String>) {
fun testDestructuring(pp: List<Pair<Int, String>>) {
{ // BLOCK
val tmp0_iterator: Iterator<Pair<Int, String>> = pp.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val tmp1_loop_parameter: Pair<Int, String> = tmp0_iterator.next()
val i: Int = tmp1_loop_parameter.component1()
val s: String = tmp1_loop_parameter.component2()
val tmp_2: Iterator<Pair<Int, String>> = pp.iterator()
while (tmp_2.hasNext()) { // BLOCK
val tmp_3: Pair<Int, String> = tmp_2.next()
val i: Int = tmp_3.component1()
val s: String = tmp_3.component2()
{ // BLOCK
println(message = i)
println(message = s)
@@ -36,9 +36,9 @@ fun testDestructuring(pp: List<Pair<Int, String>>) {
fun testRange() {
{ // BLOCK
val tmp0_iterator: IntIterator = 1.rangeTo(other = 10).iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val i: Int = tmp0_iterator.next()
val tmp_4: IntIterator = 1.rangeTo(other = 10).iterator()
while (tmp_4.hasNext()) { // BLOCK
val i: Int = tmp_4.next()
}
}
}
@@ -1,8 +1,8 @@
fun testForBreak1(ss: List<String>) {
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
while (<iterator>.hasNext()) { // BLOCK
val s: String = <iterator>.next()
val tmp_0: Iterator<String> = ss.iterator()
while (tmp_0.hasNext()) { // BLOCK
val s: String = tmp_0.next()
{ // BLOCK
break
}
@@ -12,14 +12,14 @@ fun testForBreak1(ss: List<String>) {
fun testForBreak2(ss: List<String>) {
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
OUTER@ while (<iterator>.hasNext()) { // BLOCK
val s1: String = <iterator>.next()
val tmp_1: Iterator<String> = ss.iterator()
OUTER@ while (tmp_1.hasNext()) { // BLOCK
val s1: String = tmp_1.next()
{ // BLOCK
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
INNER@ while (<iterator>.hasNext()) { // BLOCK
val s2: String = <iterator>.next()
val tmp_2: Iterator<String> = ss.iterator()
INNER@ while (tmp_2.hasNext()) { // BLOCK
val s2: String = tmp_2.next()
{ // BLOCK
break@OUTER
break@INNER
@@ -35,9 +35,9 @@ fun testForBreak2(ss: List<String>) {
fun testForContinue1(ss: List<String>) {
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
while (<iterator>.hasNext()) { // BLOCK
val s: String = <iterator>.next()
val tmp_3: Iterator<String> = ss.iterator()
while (tmp_3.hasNext()) { // BLOCK
val s: String = tmp_3.next()
{ // BLOCK
continue
}
@@ -47,14 +47,14 @@ fun testForContinue1(ss: List<String>) {
fun testForContinue2(ss: List<String>) {
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
OUTER@ while (<iterator>.hasNext()) { // BLOCK
val s1: String = <iterator>.next()
val tmp_4: Iterator<String> = ss.iterator()
OUTER@ while (tmp_4.hasNext()) { // BLOCK
val s1: String = tmp_4.next()
{ // BLOCK
{ // BLOCK
val <iterator>: Iterator<String> = ss.iterator()
INNER@ while (<iterator>.hasNext()) { // BLOCK
val s2: String = <iterator>.next()
val tmp_5: Iterator<String> = ss.iterator()
INNER@ while (tmp_5.hasNext()) { // BLOCK
val s2: String = tmp_5.next()
{ // BLOCK
continue@OUTER
continue@INNER
@@ -1,8 +1,8 @@
fun testForBreak1(ss: List<String>) {
{ // BLOCK
val tmp0_iterator: Iterator<String> = ss.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val s: String = tmp0_iterator.next()
val tmp_0: Iterator<String> = ss.iterator()
while (tmp_0.hasNext()) { // BLOCK
val s: String = tmp_0.next()
{ // BLOCK
break
}
@@ -12,14 +12,14 @@ fun testForBreak1(ss: List<String>) {
fun testForBreak2(ss: List<String>) {
{ // BLOCK
val tmp0_iterator: Iterator<String> = ss.iterator()
OUTER@ while (tmp0_iterator.hasNext()) { // BLOCK
val s1: String = tmp0_iterator.next()
val tmp_1: Iterator<String> = ss.iterator()
OUTER@ while (tmp_1.hasNext()) { // BLOCK
val s1: String = tmp_1.next()
{ // BLOCK
{ // BLOCK
val tmp1_iterator: Iterator<String> = ss.iterator()
INNER@ while (tmp1_iterator.hasNext()) { // BLOCK
val s2: String = tmp1_iterator.next()
val tmp_2: Iterator<String> = ss.iterator()
INNER@ while (tmp_2.hasNext()) { // BLOCK
val s2: String = tmp_2.next()
{ // BLOCK
break@OUTER
break@INNER
@@ -35,9 +35,9 @@ fun testForBreak2(ss: List<String>) {
fun testForContinue1(ss: List<String>) {
{ // BLOCK
val tmp0_iterator: Iterator<String> = ss.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val s: String = tmp0_iterator.next()
val tmp_3: Iterator<String> = ss.iterator()
while (tmp_3.hasNext()) { // BLOCK
val s: String = tmp_3.next()
{ // BLOCK
continue
}
@@ -47,14 +47,14 @@ fun testForContinue1(ss: List<String>) {
fun testForContinue2(ss: List<String>) {
{ // BLOCK
val tmp0_iterator: Iterator<String> = ss.iterator()
OUTER@ while (tmp0_iterator.hasNext()) { // BLOCK
val s1: String = tmp0_iterator.next()
val tmp_4: Iterator<String> = ss.iterator()
OUTER@ while (tmp_4.hasNext()) { // BLOCK
val s1: String = tmp_4.next()
{ // BLOCK
{ // BLOCK
val tmp1_iterator: Iterator<String> = ss.iterator()
INNER@ while (tmp1_iterator.hasNext()) { // BLOCK
val s2: String = tmp1_iterator.next()
val tmp_5: Iterator<String> = ss.iterator()
INNER@ while (tmp_5.hasNext()) { // BLOCK
val s2: String = tmp_5.next()
{ // BLOCK
continue@OUTER
continue@INNER
@@ -32,9 +32,9 @@ interface IReceiver {
operator fun IntCell.next(): Int {
return { // BLOCK
val <unary>: Int = <this>.<get-value>()
<this>.<set-value>(<set-?> = <unary>.dec())
<unary>
val tmp_0: Int = <this>.<get-value>()
<this>.<set-value>(<set-?> = tmp_0.dec())
tmp_0
}
}
@@ -42,9 +42,9 @@ interface IReceiver {
fun IReceiver.test() {
{ // BLOCK
val <iterator>: IntCell = (<this>, FiveTimes).iterator()
while ((<this>, <iterator>).hasNext()) { // BLOCK
val i: Int = (<this>, <iterator>).next()
val tmp_1: IntCell = (<this>, FiveTimes).iterator()
while ((<this>, tmp_1).hasNext()) { // BLOCK
val i: Int = (<this>, tmp_1).next()
{ // BLOCK
println(message = i)
}
@@ -32,11 +32,11 @@ interface IReceiver {
operator fun IntCell.next(): Int {
return { // BLOCK
val tmp0_this: IntCell = <this>
val tmp_0: IntCell = <this>
{ // BLOCK
val tmp1: Int = tmp0_this.<get-value>()
tmp0_this.<set-value>(<set-?> = tmp1.dec())
tmp1
val tmp_1: Int = tmp_0.<get-value>()
tmp_0.<set-value>(<set-?> = tmp_1.dec())
tmp_1
}
}
}
@@ -45,9 +45,9 @@ interface IReceiver {
fun IReceiver.test() {
{ // BLOCK
val tmp0_iterator: IntCell = (<this>, FiveTimes).iterator()
while ((<this>, tmp0_iterator).hasNext()) { // BLOCK
val i: Int = (<this>, tmp0_iterator).next()
val tmp_2: IntCell = (<this>, FiveTimes).iterator()
while ((<this>, tmp_2).hasNext()) { // BLOCK
val i: Int = (<this>, tmp_2).next()
{ // BLOCK
println(message = i)
}
@@ -7,8 +7,8 @@ private operator fun J.component2(): Int {
}
fun test() {
val <destruct>: @FlexibleNullability J? = j()
val a: Int = <destruct>.component1()
val b: Int = <destruct> /*!! J */.component2()
val tmp_0: @FlexibleNullability J? = j()
val a: Int = tmp_0.component1()
val b: Int = tmp_0 /*!! J */.component2()
}
@@ -8,8 +8,8 @@ private operator fun J.component2(): Int {
fun test() {
// COMPOSITE {
val tmp0_container: @FlexibleNullability J? = j()
val a: Int = tmp0_container.component1()
val b: Int = tmp0_container /*!! J */.component2()
val tmp_0: @FlexibleNullability J? = j()
val a: Int = tmp_0.component1()
val b: Int = tmp_0 /*!! J */.component2()
// }
}
@@ -64,14 +64,14 @@ fun testVarPrefix() {
fun testVarPostfix() {
var x: Int = 0
val x1: Int = { // BLOCK
val <unary>: Int = x
x = <unary>.inc()
<unary>
val tmp_0: Int = x
x = tmp_0.inc()
tmp_0
}
val x2: Int = { // BLOCK
val <unary>: Int = x
x = <unary>.dec()
<unary>
val tmp_1: Int = x
x = tmp_1.dec()
tmp_1
}
}
@@ -88,106 +88,106 @@ fun testPropPrefix() {
fun testPropPostfix() {
val p1: Int = { // BLOCK
val <unary>: Int = <get-p>()
<set-p>(<set-?> = <unary>.inc())
<unary>
val tmp_2: Int = <get-p>()
<set-p>(<set-?> = tmp_2.inc())
tmp_2
}
val p2: Int = { // BLOCK
val <unary>: Int = <get-p>()
<set-p>(<set-?> = <unary>.dec())
<unary>
val tmp_3: Int = <get-p>()
<set-p>(<set-?> = tmp_3.dec())
tmp_3
}
}
fun testArrayPrefix() {
val a1: Int = { // BLOCK
val <array>: IntArray = <get-arr>()
val <index_0>: Int = 0
<array>.set(index = <index_0>, value = <array>.get(index = <index_0>).inc())
<array>.get(index = <index_0>)
val tmp_4: IntArray = <get-arr>()
val tmp_5: Int = 0
tmp_4.set(index = tmp_5, value = tmp_4.get(index = tmp_5).inc())
tmp_4.get(index = tmp_5)
}
val a2: Int = { // BLOCK
val <array>: IntArray = <get-arr>()
val <index_0>: Int = 0
<array>.set(index = <index_0>, value = <array>.get(index = <index_0>).dec())
<array>.get(index = <index_0>)
val tmp_6: IntArray = <get-arr>()
val tmp_7: Int = 0
tmp_6.set(index = tmp_7, value = tmp_6.get(index = tmp_7).dec())
tmp_6.get(index = tmp_7)
}
}
fun testArrayPostfix() {
val a1: Int = { // BLOCK
val <array>: IntArray = <get-arr>()
val <index_0>: Int = 0
val <unary>: Int = <array>.get(index = <index_0>)
<array>.set(index = <index_0>, value = <unary>.inc())
<unary>
val tmp_8: IntArray = <get-arr>()
val tmp_9: Int = 0
val tmp_10: Int = tmp_8.get(index = tmp_9)
tmp_8.set(index = tmp_9, value = tmp_10.inc())
tmp_10
}
val a2: Int = { // BLOCK
val <array>: IntArray = <get-arr>()
val <index_0>: Int = 0
val <unary>: Int = <array>.get(index = <index_0>)
<array>.set(index = <index_0>, value = <unary>.dec())
<unary>
val tmp_11: IntArray = <get-arr>()
val tmp_12: Int = 0
val tmp_13: Int = tmp_11.get(index = tmp_12)
tmp_11.set(index = tmp_12, value = tmp_13.dec())
tmp_13
}
}
fun testClassPropPrefix() {
val p1: Int = { // BLOCK
val <receiver>: C = C()
<receiver>.<set-p>(<set-?> = <receiver>.<get-p>().inc())
<receiver>.<get-p>()
val tmp_14: C = C()
tmp_14.<set-p>(<set-?> = tmp_14.<get-p>().inc())
tmp_14.<get-p>()
}
val p2: Int = { // BLOCK
val <receiver>: C = C()
<receiver>.<set-p>(<set-?> = <receiver>.<get-p>().dec())
<receiver>.<get-p>()
val tmp_15: C = C()
tmp_15.<set-p>(<set-?> = tmp_15.<get-p>().dec())
tmp_15.<get-p>()
}
}
fun testClassPropPostfix() {
val p1: Int = { // BLOCK
val <receiver>: C = C()
val <unary>: Int = <receiver>.<get-p>()
<receiver>.<set-p>(<set-?> = <unary>.inc())
<unary>
val tmp_16: C = C()
val tmp_17: Int = tmp_16.<get-p>()
tmp_16.<set-p>(<set-?> = tmp_17.inc())
tmp_17
}
val p2: Int = { // BLOCK
val <receiver>: C = C()
val <unary>: Int = <receiver>.<get-p>()
<receiver>.<set-p>(<set-?> = <unary>.dec())
<unary>
val tmp_18: C = C()
val tmp_19: Int = tmp_18.<get-p>()
tmp_18.<set-p>(<set-?> = tmp_19.dec())
tmp_19
}
}
fun testClassOperatorPrefix() {
val a1: Int = { // BLOCK
val <array>: C = C()
val <index_0>: Int = 0
<array>.set(i = <index_0>, value = <array>.get(i = <index_0>).inc())
<array>.get(i = <index_0>)
val tmp_20: C = C()
val tmp_21: Int = 0
tmp_20.set(i = tmp_21, value = tmp_20.get(i = tmp_21).inc())
tmp_20.get(i = tmp_21)
}
val a2: Int = { // BLOCK
val <array>: C = C()
val <index_0>: Int = 0
<array>.set(i = <index_0>, value = <array>.get(i = <index_0>).dec())
<array>.get(i = <index_0>)
val tmp_22: C = C()
val tmp_23: Int = 0
tmp_22.set(i = tmp_23, value = tmp_22.get(i = tmp_23).dec())
tmp_22.get(i = tmp_23)
}
}
fun testClassOperatorPostfix() {
val a1: Int = { // BLOCK
val <array>: C = C()
val <index_0>: Int = 0
val <unary>: Int = <array>.get(i = <index_0>)
<array>.set(i = <index_0>, value = <unary>.inc())
<unary>
val tmp_24: C = C()
val tmp_25: Int = 0
val tmp_26: Int = tmp_24.get(i = tmp_25)
tmp_24.set(i = tmp_25, value = tmp_26.inc())
tmp_26
}
val a2: Int = { // BLOCK
val <array>: C = C()
val <index_0>: Int = 0
val <unary>: Int = <array>.get(i = <index_0>)
<array>.set(i = <index_0>, value = <unary>.dec())
<unary>
val tmp_27: C = C()
val tmp_28: Int = 0
val tmp_29: Int = tmp_27.get(i = tmp_28)
tmp_27.set(i = tmp_28, value = tmp_29.dec())
tmp_29
}
}
@@ -204,45 +204,45 @@ fun testObjectPropPrefix() {
fun testObjectPropPostfix() {
val p1: Int = { // BLOCK
val <unary>: Int = O.<get-p>()
O.<set-p>(<set-?> = <unary>.inc())
<unary>
val tmp_30: Int = O.<get-p>()
O.<set-p>(<set-?> = tmp_30.inc())
tmp_30
}
val p2: Int = { // BLOCK
val <unary>: Int = O.<get-p>()
O.<set-p>(<set-?> = <unary>.dec())
<unary>
val tmp_31: Int = O.<get-p>()
O.<set-p>(<set-?> = tmp_31.dec())
tmp_31
}
}
fun testObjectOperatorPrefix() {
val a1: Int = { // BLOCK
val <array>: O = O
val <index_0>: Int = 0
<array>.set(i = <index_0>, value = <array>.get(i = <index_0>).inc())
<array>.get(i = <index_0>)
val tmp_32: O = O
val tmp_33: Int = 0
tmp_32.set(i = tmp_33, value = tmp_32.get(i = tmp_33).inc())
tmp_32.get(i = tmp_33)
}
val a2: Int = { // BLOCK
val <array>: O = O
val <index_0>: Int = 0
<array>.set(i = <index_0>, value = <array>.get(i = <index_0>).dec())
<array>.get(i = <index_0>)
val tmp_34: O = O
val tmp_35: Int = 0
tmp_34.set(i = tmp_35, value = tmp_34.get(i = tmp_35).dec())
tmp_34.get(i = tmp_35)
}
}
fun testObjectOperatorPostfix() {
val a1: Int = { // BLOCK
val <array>: O = O
val <index_0>: Int = 0
val <unary>: Int = <array>.get(i = <index_0>)
<array>.set(i = <index_0>, value = <unary>.inc())
<unary>
val tmp_36: O = O
val tmp_37: Int = 0
val tmp_38: Int = tmp_36.get(i = tmp_37)
tmp_36.set(i = tmp_37, value = tmp_38.inc())
tmp_38
}
val a2: Int = { // BLOCK
val <array>: O = O
val <index_0>: Int = 0
val <unary>: Int = <array>.get(i = <index_0>)
<array>.set(i = <index_0>, value = <unary>.dec())
<unary>
val tmp_39: O = O
val tmp_40: Int = 0
val tmp_41: Int = tmp_39.get(i = tmp_40)
tmp_39.set(i = tmp_40, value = tmp_41.dec())
tmp_41
}
}
@@ -64,14 +64,14 @@ fun testVarPrefix() {
fun testVarPostfix() {
var x: Int = 0
val x1: Int = { // BLOCK
val tmp0: Int = x
x = tmp0.inc()
tmp0
val tmp_0: Int = x
x = tmp_0.inc()
tmp_0
}
val x2: Int = { // BLOCK
val tmp1: Int = x
x = tmp1.dec()
tmp1
val tmp_1: Int = x
x = tmp_1.dec()
tmp_1
}
}
@@ -93,184 +93,184 @@ fun testPropPrefix() {
fun testPropPostfix() {
val p1: Int = { // BLOCK
{ // BLOCK
val tmp0: Int = <get-p>()
<set-p>(<set-?> = tmp0.inc())
tmp0
val tmp_2: Int = <get-p>()
<set-p>(<set-?> = tmp_2.inc())
tmp_2
}
}
val p2: Int = { // BLOCK
{ // BLOCK
val tmp1: Int = <get-p>()
<set-p>(<set-?> = tmp1.dec())
tmp1
val tmp_3: Int = <get-p>()
<set-p>(<set-?> = tmp_3.dec())
tmp_3
}
}
}
fun testArrayPrefix() {
val a1: Int = { // BLOCK
val tmp0_array: IntArray = <get-arr>()
val tmp1_index0: Int = 0
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).inc())
tmp0_array.get(index = tmp1_index0)
val tmp_4: IntArray = <get-arr>()
val tmp_5: Int = 0
tmp_4.set(index = tmp_5, value = tmp_4.get(index = tmp_5).inc())
tmp_4.get(index = tmp_5)
}
val a2: Int = { // BLOCK
val tmp2_array: IntArray = <get-arr>()
val tmp3_index0: Int = 0
tmp2_array.set(index = tmp3_index0, value = tmp2_array.get(index = tmp3_index0).dec())
tmp2_array.get(index = tmp3_index0)
val tmp_6: IntArray = <get-arr>()
val tmp_7: Int = 0
tmp_6.set(index = tmp_7, value = tmp_6.get(index = tmp_7).dec())
tmp_6.get(index = tmp_7)
}
}
fun testArrayPostfix() {
val a1: Int = { // BLOCK
val tmp0_array: IntArray = <get-arr>()
val tmp1_index0: Int = 0
val tmp2: Int = tmp0_array.get(index = tmp1_index0)
tmp0_array.set(index = tmp1_index0, value = tmp2.inc())
tmp2
val tmp_8: IntArray = <get-arr>()
val tmp_9: Int = 0
val tmp_10: Int = tmp_8.get(index = tmp_9)
tmp_8.set(index = tmp_9, value = tmp_10.inc())
tmp_10
}
val a2: Int = { // BLOCK
val tmp3_array: IntArray = <get-arr>()
val tmp4_index0: Int = 0
val tmp5: Int = tmp3_array.get(index = tmp4_index0)
tmp3_array.set(index = tmp4_index0, value = tmp5.dec())
tmp5
val tmp_11: IntArray = <get-arr>()
val tmp_12: Int = 0
val tmp_13: Int = tmp_11.get(index = tmp_12)
tmp_11.set(index = tmp_12, value = tmp_13.dec())
tmp_13
}
}
fun testClassPropPrefix() {
val p1: Int = { // BLOCK
val tmp0_this: C = C()
val tmp_14: C = C()
{ // BLOCK
tmp0_this.<set-p>(<set-?> = tmp0_this.<get-p>().inc())
tmp0_this.<get-p>()
tmp_14.<set-p>(<set-?> = tmp_14.<get-p>().inc())
tmp_14.<get-p>()
}
}
val p2: Int = { // BLOCK
val tmp1_this: C = C()
val tmp_15: C = C()
{ // BLOCK
tmp1_this.<set-p>(<set-?> = tmp1_this.<get-p>().dec())
tmp1_this.<get-p>()
tmp_15.<set-p>(<set-?> = tmp_15.<get-p>().dec())
tmp_15.<get-p>()
}
}
}
fun testClassPropPostfix() {
val p1: Int = { // BLOCK
val tmp0_this: C = C()
val tmp_16: C = C()
{ // BLOCK
val tmp1: Int = tmp0_this.<get-p>()
tmp0_this.<set-p>(<set-?> = tmp1.inc())
tmp1
val tmp_17: Int = tmp_16.<get-p>()
tmp_16.<set-p>(<set-?> = tmp_17.inc())
tmp_17
}
}
val p2: Int = { // BLOCK
val tmp2_this: C = C()
val tmp_18: C = C()
{ // BLOCK
val tmp3: Int = tmp2_this.<get-p>()
tmp2_this.<set-p>(<set-?> = tmp3.dec())
tmp3
val tmp_19: Int = tmp_18.<get-p>()
tmp_18.<set-p>(<set-?> = tmp_19.dec())
tmp_19
}
}
}
fun testClassOperatorPrefix() {
val a1: Int = { // BLOCK
val tmp0_array: C = C()
val tmp1_index0: Int = 0
tmp0_array.set(i = tmp1_index0, value = tmp0_array.get(i = tmp1_index0).inc())
tmp0_array.get(i = tmp1_index0)
val tmp_20: C = C()
val tmp_21: Int = 0
tmp_20.set(i = tmp_21, value = tmp_20.get(i = tmp_21).inc())
tmp_20.get(i = tmp_21)
}
val a2: Int = { // BLOCK
val tmp2_array: C = C()
val tmp3_index0: Int = 0
tmp2_array.set(i = tmp3_index0, value = tmp2_array.get(i = tmp3_index0).dec())
tmp2_array.get(i = tmp3_index0)
val tmp_22: C = C()
val tmp_23: Int = 0
tmp_22.set(i = tmp_23, value = tmp_22.get(i = tmp_23).dec())
tmp_22.get(i = tmp_23)
}
}
fun testClassOperatorPostfix() {
val a1: Int = { // BLOCK
val tmp0_array: C = C()
val tmp1_index0: Int = 0
val tmp2: Int = tmp0_array.get(i = tmp1_index0)
tmp0_array.set(i = tmp1_index0, value = tmp2.inc())
tmp2
val tmp_24: C = C()
val tmp_25: Int = 0
val tmp_26: Int = tmp_24.get(i = tmp_25)
tmp_24.set(i = tmp_25, value = tmp_26.inc())
tmp_26
}
val a2: Int = { // BLOCK
val tmp3_array: C = C()
val tmp4_index0: Int = 0
val tmp5: Int = tmp3_array.get(i = tmp4_index0)
tmp3_array.set(i = tmp4_index0, value = tmp5.dec())
tmp5
val tmp_27: C = C()
val tmp_28: Int = 0
val tmp_29: Int = tmp_27.get(i = tmp_28)
tmp_27.set(i = tmp_28, value = tmp_29.dec())
tmp_29
}
}
fun testObjectPropPrefix() {
val p1: Int = { // BLOCK
val tmp0_this: O = O
val tmp_30: O = O
{ // BLOCK
tmp0_this.<set-p>(<set-?> = tmp0_this.<get-p>().inc())
tmp0_this.<get-p>()
tmp_30.<set-p>(<set-?> = tmp_30.<get-p>().inc())
tmp_30.<get-p>()
}
}
val p2: Int = { // BLOCK
val tmp1_this: O = O
val tmp_31: O = O
{ // BLOCK
tmp1_this.<set-p>(<set-?> = tmp1_this.<get-p>().dec())
tmp1_this.<get-p>()
tmp_31.<set-p>(<set-?> = tmp_31.<get-p>().dec())
tmp_31.<get-p>()
}
}
}
fun testObjectPropPostfix() {
val p1: Int = { // BLOCK
val tmp0_this: O = O
val tmp_32: O = O
{ // BLOCK
val tmp1: Int = tmp0_this.<get-p>()
tmp0_this.<set-p>(<set-?> = tmp1.inc())
tmp1
val tmp_33: Int = tmp_32.<get-p>()
tmp_32.<set-p>(<set-?> = tmp_33.inc())
tmp_33
}
}
val p2: Int = { // BLOCK
val tmp2_this: O = O
val tmp_34: O = O
{ // BLOCK
val tmp3: Int = tmp2_this.<get-p>()
tmp2_this.<set-p>(<set-?> = tmp3.dec())
tmp3
val tmp_35: Int = tmp_34.<get-p>()
tmp_34.<set-p>(<set-?> = tmp_35.dec())
tmp_35
}
}
}
fun testObjectOperatorPrefix() {
val a1: Int = { // BLOCK
val tmp0_array: O = O
val tmp1_index0: Int = 0
tmp0_array.set(i = tmp1_index0, value = tmp0_array.get(i = tmp1_index0).inc())
tmp0_array.get(i = tmp1_index0)
val tmp_36: O = O
val tmp_37: Int = 0
tmp_36.set(i = tmp_37, value = tmp_36.get(i = tmp_37).inc())
tmp_36.get(i = tmp_37)
}
val a2: Int = { // BLOCK
val tmp2_array: O = O
val tmp3_index0: Int = 0
tmp2_array.set(i = tmp3_index0, value = tmp2_array.get(i = tmp3_index0).dec())
tmp2_array.get(i = tmp3_index0)
val tmp_38: O = O
val tmp_39: Int = 0
tmp_38.set(i = tmp_39, value = tmp_38.get(i = tmp_39).dec())
tmp_38.get(i = tmp_39)
}
}
fun testObjectOperatorPostfix() {
val a1: Int = { // BLOCK
val tmp0_array: O = O
val tmp1_index0: Int = 0
val tmp2: Int = tmp0_array.get(i = tmp1_index0)
tmp0_array.set(i = tmp1_index0, value = tmp2.inc())
tmp2
val tmp_40: O = O
val tmp_41: Int = 0
val tmp_42: Int = tmp_40.get(i = tmp_41)
tmp_40.set(i = tmp_41, value = tmp_42.inc())
tmp_42
}
val a2: Int = { // BLOCK
val tmp3_array: O = O
val tmp4_index0: Int = 0
val tmp5: Int = tmp3_array.get(i = tmp4_index0)
tmp3_array.set(i = tmp4_index0, value = tmp5.dec())
tmp5
val tmp_43: O = O
val tmp_44: Int = 0
val tmp_45: Int = tmp_43.get(i = tmp_44)
tmp_43.set(i = tmp_44, value = tmp_45.dec())
tmp_45
}
}
@@ -2,13 +2,13 @@ fun <F : Any?> test(j: J<F>) {
j.getFoo() /*~> Unit */
j.setFoo(x = 1)
{ // BLOCK
val <receiver>: J<F> = j
val <unary>: Int = <receiver>.getFoo()
<receiver>.setFoo(x = <unary>.inc())
<unary>
val tmp_0: J<F> = j
val tmp_1: Int = tmp_0.getFoo()
tmp_0.setFoo(x = tmp_1.inc())
tmp_1
} /*~> Unit */
{ // BLOCK
val <receiver>: J<F> = j
<receiver>.setFoo(x = <receiver>.getFoo().plus(other = 1))
val tmp_2: J<F> = j
tmp_2.setFoo(x = tmp_2.getFoo().plus(other = 1))
}
}
@@ -2,15 +2,15 @@ fun <F : Any?> test(j: J<F>) {
j.getFoo<F>() /*~> Unit */
j.setFoo<F>(x = 1)
{ // BLOCK
val tmp0_receiver: J<F> = j
val tmp_0: J<F> = j
{ // BLOCK
val tmp1: Int = tmp0_receiver.getFoo<F>()
tmp0_receiver.setFoo<F>(x = tmp1.inc())
tmp1
val tmp_1: Int = tmp_0.getFoo<F>()
tmp_0.setFoo<F>(x = tmp_1.inc())
tmp_1
}
} /*~> Unit */
{ // BLOCK
val tmp2_receiver: J<F> = j
tmp2_receiver.setFoo<F>(x = tmp2_receiver.getFoo<F>().plus(other = 1))
val tmp_2: J<F> = j
tmp_2.setFoo<F>(x = tmp_2.getFoo<F>().plus(other = 1))
}
}
@@ -2,13 +2,13 @@ fun test(j: J) {
j.getFoo() /*~> Unit */
j.setFoo(x = 1)
{ // BLOCK
val <receiver>: J = j
val <unary>: Int = <receiver>.getFoo()
<receiver>.setFoo(x = <unary>.inc())
<unary>
val tmp_0: J = j
val tmp_1: Int = tmp_0.getFoo()
tmp_0.setFoo(x = tmp_1.inc())
tmp_1
} /*~> Unit */
{ // BLOCK
val <receiver>: J = j
<receiver>.setFoo(x = <receiver>.getFoo().plus(other = 1))
val tmp_2: J = j
tmp_2.setFoo(x = tmp_2.getFoo().plus(other = 1))
}
}
@@ -2,15 +2,15 @@ fun test(j: J) {
j.getFoo() /*~> Unit */
j.setFoo(x = 1)
{ // BLOCK
val tmp0_receiver: J = j
val tmp_0: J = j
{ // BLOCK
val tmp1: Int = tmp0_receiver.getFoo()
tmp0_receiver.setFoo(x = tmp1.inc())
tmp1
val tmp_1: Int = tmp_0.getFoo()
tmp_0.setFoo(x = tmp_1.inc())
tmp_1
}
} /*~> Unit */
{ // BLOCK
val tmp2_receiver: J = j
tmp2_receiver.setFoo(x = tmp2_receiver.getFoo().plus(other = 1))
val tmp_2: J = j
tmp_2.setFoo(x = tmp_2.getFoo().plus(other = 1))
}
}
+4 -4
View File
@@ -34,12 +34,12 @@ class Test1 : A {
/* <init>() */
{ // BLOCK
val tmp0_this: Test1 = <this>
tmp0_this.<get-x>().plusAssign(x = 42)
val tmp_0: Test1 = <this>
tmp_0.<get-x>().plusAssign(x = 42)
}
{ // BLOCK
val tmp1_this: Test1 = <this>
tmp1_this.<set-y>(<set-?> = tmp1_this.<get-y>().plus(other = 42))
val tmp_1: Test1 = <this>
tmp_1.<set-y>(<set-?> = tmp_1.<get-y>().plus(other = 42))
}
}
+10 -10
View File
@@ -20,20 +20,20 @@ fun testSimpleAssignment(a: A) {
fun testPostfixIncrement(a: A): Int {
return { // BLOCK
val <array>: A = a
val <index_0>: Int = 1
val <index_1>: Int = 2
val <unary>: Int = <array>.get(xs = [<index_0>, <index_1>])
<array>.set(i = <index_0>, j = <index_1>, v = <unary>.inc())
<unary>
val tmp_0: A = a
val tmp_1: Int = 1
val tmp_2: Int = 2
val tmp_3: Int = tmp_0.get(xs = [tmp_1, tmp_2])
tmp_0.set(i = tmp_1, j = tmp_2, v = tmp_3.inc())
tmp_3
}
}
fun testCompoundAssignment(a: A) {
{ // BLOCK
val <array>: A = a
val <index_0>: Int = 1
val <index_1>: Int = 2
<array>.set(i = <index_0>, j = <index_1>, v = <array>.get(xs = [<index_0>, <index_1>]).plus(other = 10))
val tmp_4: A = a
val tmp_5: Int = 1
val tmp_6: Int = 2
tmp_4.set(i = tmp_5, j = tmp_6, v = tmp_4.get(xs = [tmp_5, tmp_6]).plus(other = 10))
}
}
+10 -10
View File
@@ -20,20 +20,20 @@ fun testSimpleAssignment(a: A) {
fun testPostfixIncrement(a: A): Int {
return { // BLOCK
val tmp0_array: A = a
val tmp1_index0: Int = 1
val tmp2_index1: Int = 2
val tmp3: Int = tmp0_array.get(xs = [tmp1_index0, tmp2_index1])
tmp0_array.set(i = tmp1_index0, j = tmp2_index1, v = tmp3.inc())
tmp3
val tmp_0: A = a
val tmp_1: Int = 1
val tmp_2: Int = 2
val tmp_3: Int = tmp_0.get(xs = [tmp_1, tmp_2])
tmp_0.set(i = tmp_1, j = tmp_2, v = tmp_3.inc())
tmp_3
}
}
fun testCompoundAssignment(a: A) {
{ // BLOCK
val tmp0_array: A = a
val tmp1_index0: Int = 1
val tmp2_index1: Int = 2
tmp0_array.set(i = tmp1_index0, j = tmp2_index1, v = tmp0_array.get(xs = [tmp1_index0, tmp2_index1]).plus(other = 10))
val tmp_4: A = a
val tmp_5: Int = 1
val tmp_6: Int = 2
tmp_4.set(i = tmp_5, j = tmp_6, v = tmp_4.get(xs = [tmp_5, tmp_6]).plus(other = 10))
}
}
@@ -20,18 +20,18 @@ fun testSimpleAssignment(a: A) {
fun testPostfixIncrement(a: A): Int {
return { // BLOCK
val <array>: A = a
val <index_0>: Int = 1
val <unary>: Int = <array>.get(i = <index_0>)
<array>.set(i = <index_0>, v = <unary>.inc())
<unary>
val tmp_0: A = a
val tmp_1: Int = 1
val tmp_2: Int = tmp_0.get(i = tmp_1)
tmp_0.set(i = tmp_1, v = tmp_2.inc())
tmp_2
}
}
fun testCompoundAssignment(a: A) {
{ // BLOCK
val <array>: A = a
val <index_0>: Int = 1
<array>.set(i = <index_0>, v = <array>.get(i = <index_0>).plus(other = 10))
val tmp_3: A = a
val tmp_4: Int = 1
tmp_3.set(i = tmp_4, v = tmp_3.get(i = tmp_4).plus(other = 10))
}
}
+8 -8
View File
@@ -20,18 +20,18 @@ fun testSimpleAssignment(a: A) {
fun testPostfixIncrement(a: A): Int {
return { // BLOCK
val tmp0_array: A = a
val tmp1_index0: Int = 1
val tmp2: Int = tmp0_array.get(i = tmp1_index0)
tmp0_array.set(i = tmp1_index0, v = tmp2.inc())
tmp2
val tmp_0: A = a
val tmp_1: Int = 1
val tmp_2: Int = tmp_0.get(i = tmp_1)
tmp_0.set(i = tmp_1, v = tmp_2.inc())
tmp_2
}
}
fun testCompoundAssignment(a: A) {
{ // BLOCK
val tmp0_array: A = a
val tmp1_index0: Int = 1
tmp0_array.set(i = tmp1_index0, v = tmp0_array.get(i = tmp1_index0).plus(other = 10))
val tmp_3: A = a
val tmp_4: Int = 1
tmp_3.set(i = tmp_4, v = tmp_3.get(i = tmp_4).plus(other = 10))
}
}
+6 -6
View File
@@ -12,17 +12,17 @@ fun test(x: X, nx: X?) {
x.<get-xs>() as MutableList<Int>.plusAssign<Int>(element = 3)
x.f() as MutableList<Int>.plusAssign<Int>(element = 4)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp0_safe_receiver: X? = nx
val tmp_0: X? = nx
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.<get-xs>()
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.<get-xs>()
}
}).plusAssign<Int>(element = 5)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp1_safe_receiver: X? = nx
val tmp_1: X? = nx
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.f()
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.f()
}
}).plusAssign<Int>(element = 6)
}
+8 -8
View File
@@ -8,24 +8,24 @@ interface X {
fun test(x: X, nx: X?) {
{ // BLOCK
val tmp0_this: X = x
tmp0_this.<get-xs>().plusAssign<Int>(element = 1)
val tmp_0: X = x
tmp_0.<get-xs>().plusAssign<Int>(element = 1)
}
x.f().plusAssign<Int>(element = 2)
x.<get-xs>() as MutableList<Int>.plusAssign<Int>(element = 3)
x.f() as MutableList<Int>.plusAssign<Int>(element = 4)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp1_safe_receiver: X? = nx
val tmp_1: X? = nx
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.<get-xs>()
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.<get-xs>()
}
}).plusAssign<Int>(element = 5)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp2_safe_receiver: X? = nx
val tmp_2: X? = nx
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
else -> tmp2_safe_receiver.f()
EQEQ(arg0 = tmp_2, arg1 = null) -> null
else -> tmp_2.f()
}
}).plusAssign<Int>(element = 6)
}
+36 -36
View File
@@ -4,82 +4,82 @@ fun <T : Any?> magic(): T {
fun <T : Any?> test(value: T, value2: T) {
val x1: Any = { // BLOCK
val <elvis>: T = value
val tmp_0: T = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_0, arg1 = null) -> 42
else -> tmp_0
}
}
val x2: Any = { // BLOCK
val <elvis>: T = value
val tmp_1: T = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> { // BLOCK
val <elvis>: T = value2
EQEQ(arg0 = tmp_1, arg1 = null) -> { // BLOCK
val tmp_2: T = value2
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_2, arg1 = null) -> 42
else -> tmp_2
}
}
else -> <elvis>
else -> tmp_1
}
}
val x3: Any = { // BLOCK
val <elvis>: Any? = { // BLOCK
val <elvis>: T = value
val tmp_3: Any? = { // BLOCK
val tmp_4: T = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> value2
else -> <elvis>
EQEQ(arg0 = tmp_4, arg1 = null) -> value2
else -> tmp_4
}
}
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_3, arg1 = null) -> 42
else -> tmp_3
}
}
val x4: Any = { // BLOCK
val <elvis>: Any? = { // BLOCK
val <elvis>: T = value
val tmp_5: Any? = { // BLOCK
val tmp_6: T = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> value2
else -> <elvis>
EQEQ(arg0 = tmp_6, arg1 = null) -> value2
else -> tmp_6
}
}
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_5, arg1 = null) -> 42
else -> tmp_5
}
}
val x5: Any = { // BLOCK
val <elvis>: Any? = magic<Any?>()
val tmp_7: Any? = magic<Any?>()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_7, arg1 = null) -> 42
else -> tmp_7
}
}
val x6: Any = { // BLOCK
val <elvis>: Any? = { // BLOCK
val <elvis>: T = value
val tmp_8: Any? = { // BLOCK
val tmp_9: T = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> magic<Any?>()
else -> <elvis>
EQEQ(arg0 = tmp_9, arg1 = null) -> magic<Any?>()
else -> tmp_9
}
}
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_8, arg1 = null) -> 42
else -> tmp_8
}
}
val x7: Any = { // BLOCK
val <elvis>: Any? = { // BLOCK
val <elvis>: Any? = magic<Any?>()
val tmp_10: Any? = { // BLOCK
val tmp_11: Any? = magic<Any?>()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> value
else -> <elvis>
EQEQ(arg0 = tmp_11, arg1 = null) -> value
else -> tmp_11
}
}
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis>
EQEQ(arg0 = tmp_10, arg1 = null) -> 42
else -> tmp_10
}
}
}

Some files were not shown because too many files have changed in this diff Show More