Preserve origins when desugaring augmented array assignments

^KT-63827: Fixed
This commit is contained in:
vladislav.grechko
2023-12-20 17:15:40 +00:00
committed by Space Team
parent eb790732fd
commit 77d0d1073e
27 changed files with 259 additions and 161 deletions
@@ -129,6 +129,7 @@ internal open class FirElementsRecorder : FirVisitor<Unit, MutableMap<KtElement,
it.kind == KtFakeSourceElementKind.DesugaredPostfixNameReference ||
it.kind == KtFakeSourceElementKind.SmartCastExpression ||
it.kind == KtFakeSourceElementKind.DanglingModifierList ||
it.isSourceForArrayAugmentedAssign(element) ||
it.isSourceForCompoundAccess(element)
}.psi as? KtElement
?: return
@@ -155,6 +156,12 @@ internal open class FirElementsRecorder : FirVisitor<Unit, MutableMap<KtElement,
}
}
private fun KtSourceElement.isSourceForArrayAugmentedAssign(fir: FirElement) =
// after desugaring, we also have FirBlock with the same source element.
// We need to filter it out to map this source element to set/plusAssign call, so we check `is FirFunctionCall`
(kind is KtFakeSourceElementKind.DesugaredArrayAugmentedAssign) && fir is FirFunctionCall
private fun FirElement.isReadInCompoundCall(): Boolean {
if (this is FirPropertyAccessExpression) return true
if (this !is FirFunctionCall) return false
@@ -0,0 +1,12 @@
class Foo {
companion object {
operator fun get(n: Int): Int = 42
}
}
private operator fun Any.set(i: Int, value: Int) {}
fun usageFoo() {
<expr>Foo[1] -= 5</expr>
}
@@ -0,0 +1,37 @@
KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: DesugaredArrayMinusAssign
FIR element rendered:
R|<local>/<array>|.R|/set|(R|<local>/<index_0>|, R|<local>/<array>|.R|/Foo.Companion.get|(R|<local>/<index_0>|).R|kotlin/Int.minus|(Int(5)))
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] arrayMinusAssignOperatorsInVariousScopes.kt
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
public [ResolvedTo(STATUS)] [ContainingClassKey=Foo] constructor(): R|Foo| {
LAZY_super<R|kotlin/Any|>
}
public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| {
private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Foo.Companion| {
LAZY_super<R|kotlin/Any|>
}
public final operator [ResolvedTo(CONTRACTS)] fun get([ResolvedTo(CONTRACTS)] n: R|kotlin/Int|): R|kotlin/Int| {
^get IntegerLiteral(42)
}
}
}
private final operator [ResolvedTo(CONTRACTS)] fun R|kotlin/Any|.set([ResolvedTo(CONTRACTS)] i: R|kotlin/Int|, [ResolvedTo(CONTRACTS)] value: R|kotlin/Int|): R|kotlin/Unit| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun usageFoo(): R|kotlin/Unit| {
{
[ResolvedTo(BODY_RESOLVE)] lval <array>: R|Foo.Companion| = Q|Foo|
[ResolvedTo(BODY_RESOLVE)] lval <index_0>: R|kotlin/Int| = Int(1)
R|<local>/<array>|.R|/set|(R|<local>/<index_0>|, R|<local>/<array>|.R|/Foo.Companion.get|(R|<local>/<index_0>|).R|kotlin/Int.minus|(Int(5)))
}
Unit
}
@@ -0,0 +1,10 @@
interface Bar
operator fun Bar.get(n: Int): Int = 42
private operator fun Int.timesAssign(s: String) {}
fun usageBar(bar: Bar) {
<expr>bar[1] *= "bar"</expr>
}
@@ -0,0 +1,20 @@
KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: DesugaredArrayTimesAssign
FIR element rendered:
R|<local>/bar|.R|/get|(Int(1)).R|/timesAssign|(String(bar))
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] arrayTimesAssignOperatorsInVariousScopes.kt
public abstract [ResolvedTo(STATUS)] interface Bar : R|kotlin/Any| {
}
public final operator [ResolvedTo(CONTRACTS)] fun R|Bar|.get([ResolvedTo(CONTRACTS)] n: R|kotlin/Int|): R|kotlin/Int| {
^get IntegerLiteral(42)
}
private final operator [ResolvedTo(CONTRACTS)] fun R|kotlin/Int|.timesAssign([ResolvedTo(CONTRACTS)] s: R|kotlin/String|): R|kotlin/Unit| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun usageBar([ResolvedTo(BODY_RESOLVE)] bar: R|Bar|): R|kotlin/Unit| {
R|<local>/bar|.R|/get|(Int(1)).R|/timesAssign|(String(bar))
Unit
}
@@ -1,6 +1,6 @@
KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: KtRealSourceElementKind
FIR source kind: DesugaredArrayPlusAssign
FIR element rendered:
R|<local>/<array>|.R|SubstitutionOverride</MyMap.set: R|kotlin/Unit|>|(R|<local>/<index_0>|, R|<local>/<array>|.R|SubstitutionOverride</MyMap.get: R|kotlin/Int|>|(R|<local>/<index_0>|).R|kotlin/Int.plus|(Int(1)))
@@ -1,6 +1,6 @@
KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: KtRealSourceElementKind
FIR source kind: DesugaredArrayPlusAssign
FIR element rendered:
R|<local>/<array>|.R|SubstitutionOverride</MyMap.set: R|kotlin/Unit|>|(R|<local>/<index_0>|, R|<local>/<array>|.R|SubstitutionOverride</MyMap.get: R|kotlin/Int|>|(R|<local>/<index_0>|).R|kotlin/Int.plus|(Int(1)))
@@ -1,6 +1,6 @@
KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: DesugaredCompoundAssignment
FIR source kind: DesugaredArrayPlusAssign
FIR element rendered:
R|<local>/m|.R|SubstitutionOverride</MyMap.get: R|A|>|(String(a)).R|/A.plusAssign|(Int(1))
@@ -1,6 +1,6 @@
KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: DesugaredCompoundAssignment
FIR source kind: DesugaredArrayPlusAssign
FIR element rendered:
R|<local>/m|.R|SubstitutionOverride</MyMap.get: R|A|>|(String(a)).R|/A.plusAssign|(Int(1))
@@ -1,6 +1,6 @@
KT element: KtArrayAccessExpression
FIR element: FirFunctionCallImpl
FIR source kind: KtRealSourceElementKind
FIR source kind: DesugaredArrayPlusAssign
FIR element rendered:
R|<local>/m|.R|SubstitutionOverride</MyMap.get: R|A|>|(String(a))
@@ -293,6 +293,18 @@ public class OutOfContentRootGetOrBuildFirTestGenerated extends AbstractOutOfCon
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/getOrBuildFir/calls"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
}
@Test
@TestMetadata("arrayMinusAssignOperatorsInVariousScopes.kt")
public void testArrayMinusAssignOperatorsInVariousScopes() throws Exception {
runTest("analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayMinusAssignOperatorsInVariousScopes.kt");
}
@Test
@TestMetadata("arrayTimesAssignOperatorsInVariousScopes.kt")
public void testArrayTimesAssignOperatorsInVariousScopes() throws Exception {
runTest("analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.kt");
}
@Test
@TestMetadata("callArgument.kt")
public void testCallArgument() throws Exception {
@@ -293,6 +293,18 @@ public class SourceGetOrBuildFirTestGenerated extends AbstractSourceGetOrBuildFi
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/getOrBuildFir/calls"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
}
@Test
@TestMetadata("arrayMinusAssignOperatorsInVariousScopes.kt")
public void testArrayMinusAssignOperatorsInVariousScopes() throws Exception {
runTest("analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayMinusAssignOperatorsInVariousScopes.kt");
}
@Test
@TestMetadata("arrayTimesAssignOperatorsInVariousScopes.kt")
public void testArrayTimesAssignOperatorsInVariousScopes() throws Exception {
runTest("analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.kt");
}
@Test
@TestMetadata("callArgument.kt")
public void testCallArgument() throws Exception {
@@ -544,6 +544,9 @@ internal fun FirReference.statementOrigin(): IrStatementOrigin? = when (this) {
else -> null
}
source?.kind is KtFakeSourceElementKind.DesugaredArrayAugmentedAssign ->
augmentedArrayAssignSourceKindToIrStatementOrigin[source?.kind]
else ->
null
}
@@ -882,3 +885,11 @@ internal fun FirQualifiedAccessExpression.buildSubstitutorByCalledCallable(): Co
}
return ConeSubstitutorByMap(map, session)
}
val augmentedArrayAssignSourceKindToIrStatementOrigin = mapOf(
KtFakeSourceElementKind.DesugaredArrayPlusAssign to IrStatementOrigin.PLUSEQ,
KtFakeSourceElementKind.DesugaredArrayMinusAssign to IrStatementOrigin.MINUSEQ,
KtFakeSourceElementKind.DesugaredArrayTimesAssign to IrStatementOrigin.MULTEQ,
KtFakeSourceElementKind.DesugaredArrayDivAssign to IrStatementOrigin.DIVEQ,
KtFakeSourceElementKind.DesugaredArrayRemAssign to IrStatementOrigin.PERCEQ
)
@@ -905,9 +905,15 @@ class Fir2IrVisitor(
expectedType: ConeKotlinType? = null,
): IrExpression {
return when (expression) {
is FirBlock -> expression.convertToIrExpressionOrBlock(
if (expression.source?.kind == KtFakeSourceElementKind.DesugaredForLoop) IrStatementOrigin.FOR_LOOP else null
)
is FirBlock -> {
val origin = when (expression.source?.kind) {
is KtFakeSourceElementKind.DesugaredForLoop -> IrStatementOrigin.FOR_LOOP
is KtFakeSourceElementKind.DesugaredArrayAugmentedAssign ->
augmentedArrayAssignSourceKindToIrStatementOrigin[expression.source?.kind]
else -> null
}
expression.convertToIrExpressionOrBlock(origin)
}
is FirUnitExpression -> expression.convertWithOffsets { _, endOffset ->
IrGetObjectValueImpl(
endOffset, endOffset, irBuiltIns.unitType, this.irBuiltIns.unitClass
@@ -330,6 +330,12 @@ class CallAndReferenceGenerator(
else -> error("Unexpected name")
}
is KtFakeSourceElementKind.DesugaredArrayAugmentedAssign -> when (calleeReference.resolved?.name) {
OperatorNameConventions.SET -> IrDynamicOperator.EQ
OperatorNameConventions.GET -> IrDynamicOperator.ARRAY_ACCESS
else -> error("Unexpected name")
}
else -> null
}
@@ -15,10 +15,7 @@ import org.jetbrains.kotlin.fir.declarations.utils.isExternal
import org.jetbrains.kotlin.fir.declarations.utils.isLocal
import org.jetbrains.kotlin.fir.diagnostics.*
import org.jetbrains.kotlin.fir.expressions.*
import org.jetbrains.kotlin.fir.expressions.FirOperation.AS
import org.jetbrains.kotlin.fir.expressions.FirOperation.IS
import org.jetbrains.kotlin.fir.expressions.FirOperation.NOT_IS
import org.jetbrains.kotlin.fir.expressions.FirOperation.SAFE_AS
import org.jetbrains.kotlin.fir.expressions.FirOperation.*
import org.jetbrains.kotlin.fir.expressions.builder.*
import org.jetbrains.kotlin.fir.expressions.impl.FirResolvedArgumentList
import org.jetbrains.kotlin.fir.expressions.impl.toAnnotationArgumentMapping
@@ -28,6 +25,7 @@ import org.jetbrains.kotlin.fir.extensions.extensionService
import org.jetbrains.kotlin.fir.references.*
import org.jetbrains.kotlin.fir.references.builder.buildErrorNamedReference
import org.jetbrains.kotlin.fir.references.builder.buildExplicitSuperReference
import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference
import org.jetbrains.kotlin.fir.references.builder.buildSimpleNamedReference
import org.jetbrains.kotlin.fir.references.impl.FirSimpleNamedReference
import org.jetbrains.kotlin.fir.resolve.*
@@ -600,7 +598,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
)
// x.plusAssign(y)
val assignOperatorCall = generator.createAssignOperatorCall()
val assignOperatorCall = generator.createAssignOperatorCall(KtFakeSourceElementKind.DesugaredCompoundAssignment)
val resolvedAssignCall = resolveCandidateForAssignmentOperatorCall {
assignOperatorCall.transformSingle(this, ResolutionMode.ContextDependent)
}
@@ -608,7 +606,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
val assignIsSuccessful = assignCallReference?.isError == false
// x = x + y
val simpleOperatorCall = generator.createSimpleOperatorCall()
val simpleOperatorCall = generator.createSimpleOperatorCall(KtFakeSourceElementKind.DesugaredCompoundAssignment)
val resolvedOperatorCall = resolveCandidateForAssignmentOperatorCall {
simpleOperatorCall.transformSingle(this, ResolutionMode.ContextDependent)
}
@@ -1372,10 +1370,10 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
}
}
private fun createFunctionCall(name: Name): FirFunctionCall {
private fun createFunctionCall(name: Name, fakeSourceElementKind: KtFakeSourceElementKind): FirFunctionCall {
return createFunctionCall(
name,
baseElement.source?.fakeElement(KtFakeSourceElementKind.DesugaredCompoundAssignment),
baseElement.source?.fakeElement(fakeSourceElementKind),
referenceSource,
baseElement.annotations,
lhs,
@@ -1383,12 +1381,12 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
)
}
fun createAssignOperatorCall(): FirFunctionCall {
return createFunctionCall(FirOperationNameConventions.ASSIGNMENTS.getValue(operation))
fun createAssignOperatorCall(fakeSourceElementKind: KtFakeSourceElementKind): FirFunctionCall {
return createFunctionCall(FirOperationNameConventions.ASSIGNMENTS.getValue(operation), fakeSourceElementKind)
}
fun createSimpleOperatorCall(): FirFunctionCall {
return createFunctionCall(FirOperationNameConventions.ASSIGNMENTS_TO_SIMPLE_OPERATOR.getValue(operation))
fun createSimpleOperatorCall(fakeSourceElementKind: KtFakeSourceElementKind): FirFunctionCall {
return createFunctionCall(FirOperationNameConventions.ASSIGNMENTS_TO_SIMPLE_OPERATOR.getValue(operation), fakeSourceElementKind)
}
}
@@ -1412,6 +1410,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
dataFlowAnalyzer.enterCallArguments(augmentedArraySetCall, listOf(augmentedArraySetCall.rhs))
// transformedLhsCall: a.get(index)
val transformedLhsCall = augmentedArraySetCall.lhsGetCall.transformSingle(transformer, ResolutionMode.ContextIndependent)
.also { it.setArrayAugmentedAssignSource(operation) }
val transformedRhs = augmentedArraySetCall.rhs.transformSingle(transformer, ResolutionMode.ContextDependent)
dataFlowAnalyzer.exitCallArguments()
@@ -1424,7 +1423,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
)
// a.get(b).plusAssign(c)
val assignOperatorCall = generator.createAssignOperatorCall()
val assignOperatorCall = generator.createAssignOperatorCall(operation.toArrayAugmentedAssignSourceKind())
val resolvedAssignCall = resolveCandidateForAssignmentOperatorCall {
assignOperatorCall.transformSingle(this, ResolutionMode.ContextDependent)
}
@@ -1523,6 +1522,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
statements += arrayVariable
statements += indexVariables
statements += setCall
source = augmentedArraySetCall.source?.fakeElement(augmentedArraySetCall.operation.toArrayAugmentedAssignSourceKind())
}.also {
it.replaceConeTypeOrNull(session.builtinTypes.unitType.type)
}
@@ -1627,14 +1627,14 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
transformedRhs
)
val operatorCall = generator.createSimpleOperatorCall()
val operatorCall = generator.createSimpleOperatorCall(augmentedArraySetCall.operation.toArrayAugmentedAssignSourceKind())
val resolvedOperatorCall = resolveCandidateForAssignmentOperatorCall {
operatorCall.transformSingle(this, ResolutionMode.ContextDependent)
}
val setCall = GeneratorOfPlusAssignCalls.createFunctionCall(
OperatorNameConventions.SET,
augmentedArraySetCall.source,
augmentedArraySetCall.source?.fakeElement(augmentedArraySetCall.operation.toArrayAugmentedAssignSourceKind()),
augmentedArraySetCall.calleeReference.source,
annotations = augmentedArraySetCall.annotations,
receiver = arrayAccess, // a
@@ -1726,3 +1726,26 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
}
}
private fun FirOperation.toArrayAugmentedAssignSourceKind() = when (this) {
PLUS_ASSIGN -> KtFakeSourceElementKind.DesugaredArrayPlusAssign
MINUS_ASSIGN -> KtFakeSourceElementKind.DesugaredArrayMinusAssign
TIMES_ASSIGN -> KtFakeSourceElementKind.DesugaredArrayTimesAssign
DIV_ASSIGN -> KtFakeSourceElementKind.DesugaredArrayDivAssign
REM_ASSIGN -> KtFakeSourceElementKind.DesugaredArrayRemAssign
else -> error("Unexpected operator: $name")
}
private fun FirFunctionCall.setArrayAugmentedAssignSource(operation: FirOperation) {
if (calleeReference.isError()) return
val newSource = source?.fakeElement(operation.toArrayAugmentedAssignSourceKind())
@OptIn(FirImplementationDetail::class)
replaceSource(newSource)
val oldCalleeReference = calleeReference as? FirResolvedNamedReference
?: error("${FirResolvedNamedReference::class.simpleName}} expected, got ${calleeReference.render()}")
replaceCalleeReference(buildResolvedNamedReference {
this.name = oldCalleeReference.name
this.source = newSource
this.resolvedSymbol = oldCalleeReference.resolvedSymbol
})
}
@@ -200,6 +200,16 @@ sealed class KtFakeSourceElementKind(final override val shouldSkipErrorTypeRepor
// list[0] -> list.get(0) where name reference will have a fake source element
object ArrayAccessNameReference : KtFakeSourceElementKind()
// a[b] += c -> a.set(b, a.get(b) + c) or a.get(b).plusAssign(c)
// set, get, '+', and plusAssign will have a fake source element
sealed class DesugaredArrayAugmentedAssign : KtFakeSourceElementKind()
object DesugaredArrayPlusAssign : DesugaredArrayAugmentedAssign()
object DesugaredArrayMinusAssign : DesugaredArrayAugmentedAssign()
object DesugaredArrayTimesAssign : DesugaredArrayAugmentedAssign()
object DesugaredArrayDivAssign : DesugaredArrayAugmentedAssign()
object DesugaredArrayRemAssign : DesugaredArrayAugmentedAssign()
// a[b]++
// b -> val <index0> = b where b will have fake property
object ArrayIndexExpressionReference : KtFakeSourceElementKind()
@@ -46,31 +46,31 @@ FILE fqName:<root> fileName:/arrayAugmentedAssignment1.kt
BLOCK_BODY
VAR name:x type:kotlin.IntArray [var]
CALL 'public final fun foo (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=null
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val]
GET_VAR 'var x: kotlin.IntArray declared in <root>.testVariable' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=PLUSEQ
$this: GET_VAR 'val tmp_0: kotlin.IntArray declared in <root>.testVariable' type=kotlin.IntArray origin=null
index: GET_VAR 'val tmp_1: kotlin.Int declared in <root>.testVariable' type=kotlin.Int origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=PLUSEQ
$this: GET_VAR 'val tmp_0: kotlin.IntArray declared in <root>.testVariable' type=kotlin.IntArray origin=null
index: GET_VAR 'val tmp_1: kotlin.Int declared in <root>.testVariable' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=1
FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=MULTEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.IntArray [val]
CALL 'public final fun foo (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
CALL 'public final fun bar (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=MULTEQ
$this: GET_VAR 'val tmp_2: kotlin.IntArray declared in <root>.testCall' type=kotlin.IntArray origin=null
index: GET_VAR 'val tmp_3: kotlin.Int declared in <root>.testCall' type=kotlin.Int origin=null
value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null
value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=MULTEQ
$this: GET_VAR 'val tmp_2: kotlin.IntArray declared in <root>.testCall' type=kotlin.IntArray origin=null
index: GET_VAR 'val tmp_3: kotlin.Int declared in <root>.testCall' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=2
@@ -1,57 +0,0 @@
FILE fqName:<root> fileName:/arrayAugmentedAssignment2.kt
CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IA
FUN name:get visibility:public modality:ABSTRACT <> ($this:<root>.IA, index:kotlin.String) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.IA
VALUE_PARAMETER name:index index:0 type:kotlin.String
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IB
FUN name:set visibility:public modality:ABSTRACT <> ($this:<root>.IB, $receiver:<root>.IA, index:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.IB
$receiver: VALUE_PARAMETER name:<this> type:<root>.IA
VALUE_PARAMETER name:index index:0 type:kotlin.String
VALUE_PARAMETER name:value index:1 type:kotlin.Int
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> ($receiver:<root>.IB, a:<root>.IA) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.IB
VALUE_PARAMETER name:a index:0 type:<root>.IA
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.IA [val]
GET_VAR 'a: <root>.IA declared in <root>.test' type=<root>.IA origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String [val]
CONST String type=kotlin.String value=""
CALL 'public abstract fun set (index: kotlin.String, value: kotlin.Int): kotlin.Unit declared in <root>.IB' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.IB declared in <root>.test' type=<root>.IB origin=null
$receiver: GET_VAR 'val tmp_0: <root>.IA declared in <root>.test' type=<root>.IA origin=null
index: GET_VAR 'val tmp_1: kotlin.String declared in <root>.test' type=kotlin.String origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public abstract fun get (index: kotlin.String): kotlin.Int declared in <root>.IA' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_0: <root>.IA declared in <root>.test' type=<root>.IA origin=null
index: GET_VAR 'val tmp_1: kotlin.String declared in <root>.test' type=kotlin.String origin=null
other: CONST Int type=kotlin.Int value=42
@@ -1,17 +0,0 @@
interface IA {
abstract operator fun get(index: String): Int
}
interface IB {
abstract operator fun IA.set(index: String, value: Int)
}
fun IB.test(a: IA) {
{ // BLOCK
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))
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface IA {
operator fun get(index: String): Int
}
@@ -104,7 +104,7 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
CONST Int type=kotlin.Int value=42
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.A [val]
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Function1<kotlin.Int, kotlin.Unit> [val]
@@ -116,19 +116,19 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
GET_VAR 'p0: kotlin.Int declared in <root>.test1.withVararg' type=kotlin.Int origin=null
FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in <root>.test1' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in <root>
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_0: <root>.A declared in <root>.test1' type=<root>.A origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_1: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test1' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_0: <root>.A declared in <root>.test1' type=<root>.A origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_1: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test1' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
other: CONST Int type=kotlin.Int value=1
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.B [val]
GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.B
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Function1<kotlin.Int, kotlin.Unit> [val]
@@ -140,12 +140,12 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
GET_VAR 'p0: kotlin.Int declared in <root>.test2.withVararg' type=kotlin.Int origin=null
FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in <root>.test2' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in <root>
CALL 'public final fun set (i: <root>.IFoo2, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: <root>.IFoo2, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_2: <root>.B declared in <root>.test2' type=<root>.B origin=null
i: TYPE_OP type=<root>.IFoo2 origin=SAM_CONVERSION typeOperand=<root>.IFoo2
GET_VAR 'val tmp_3: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test2' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_2: <root>.B declared in <root>.test2' type=<root>.B origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_3: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test2' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
@@ -153,17 +153,17 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
FUN name:test3 visibility:public modality:FINAL <> (fn:kotlin.Function1<kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit
VALUE_PARAMETER name:fn index:0 type:kotlin.Function1<kotlin.Int, kotlin.Unit>
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:<root>.A [val]
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1<kotlin.Int, kotlin.Unit> [val]
GET_VAR 'fn: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test3' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_4: <root>.A declared in <root>.test3' type=<root>.A origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_5: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test3' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_4: <root>.A declared in <root>.test3' type=<root>.A origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_5: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test3' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
@@ -176,16 +176,16 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.IFoo
GET_VAR 'fn: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test4' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
then: BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:<root>.A [val]
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Any [val]
GET_VAR 'fn: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test4' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_6: <root>.A declared in <root>.test4' type=<root>.A origin=null
i: GET_VAR 'val tmp_7: kotlin.Any declared in <root>.test4' type=kotlin.Any origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_6: <root>.A declared in <root>.test4' type=<root>.A origin=null
i: GET_VAR 'val tmp_7: kotlin.Any declared in <root>.test4' type=kotlin.Any origin=null
other: CONST Int type=kotlin.Int value=1
@@ -195,18 +195,18 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
TYPE_OP type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=CAST typeOperand=kotlin.Function1<kotlin.Int, kotlin.Unit>
GET_VAR 'a: kotlin.Any declared in <root>.test5' type=kotlin.Any origin=null
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:<root>.A [val]
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Function1<kotlin.Int, kotlin.Unit> [val]
TYPE_OP type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=IMPLICIT_CAST typeOperand=kotlin.Function1<kotlin.Int, kotlin.Unit>
GET_VAR 'a: kotlin.Any declared in <root>.test5' type=kotlin.Any origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_8: <root>.A declared in <root>.test5' type=<root>.A origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_9: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test5' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_8: <root>.A declared in <root>.test5' type=<root>.A origin=null
i: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
GET_VAR 'val tmp_9: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test5' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
@@ -221,16 +221,16 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
TYPE_OP type=<root>.IFoo origin=CAST typeOperand=<root>.IFoo
TYPE_OP type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=IMPLICIT_CAST typeOperand=kotlin.Function1<kotlin.Int, kotlin.Unit>
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:<root>.A [val]
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Any [val]
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_10: <root>.A declared in <root>.test6' type=<root>.A origin=null
i: GET_VAR 'val tmp_11: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_10: <root>.A declared in <root>.test6' type=<root>.A origin=null
i: GET_VAR 'val tmp_11: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
other: CONST Int type=kotlin.Int value=1
+4 -4
View File
@@ -65,19 +65,19 @@ FILE fqName:<root> fileName:/kt28456.kt
FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:<root>.A [val]
GET_VAR 'a: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=1
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=2
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_4: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
i: GET_VAR 'val tmp_5: kotlin.Int declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
j: GET_VAR 'val tmp_6: kotlin.Int declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=null
v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_4: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
GET_VAR 'val tmp_5: kotlin.Int declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
@@ -73,16 +73,16 @@ FILE fqName:<root> fileName:/kt28456b.kt
FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:<root>.A [val]
GET_VAR 'a: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=1
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_3: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
i: GET_VAR 'val tmp_4: kotlin.Int declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=null
v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_3: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
i: GET_VAR 'val tmp_4: kotlin.Int declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=10
@@ -27,7 +27,7 @@ FILE fqName:<root> fileName:/lambdaInCAO.kt
FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:kotlin.Any
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any [val]
GET_VAR 'a: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Function0<kotlin.Unit> [val]
@@ -36,11 +36,11 @@ FILE fqName:<root> fileName:/lambdaInCAO.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.test2'
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
CALL 'public final fun set (index: kotlin.Function0<kotlin.Unit>, value: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Function0<kotlin.Unit>, value: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'val tmp_0: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
index: GET_VAR 'val tmp_1: kotlin.Function0<kotlin.Unit> declared in <root>.test2' type=kotlin.Function0<kotlin.Unit> origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Function0<kotlin.Unit>): kotlin.Int declared in <root>' type=kotlin.Int origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (index: kotlin.Function0<kotlin.Unit>): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
$receiver: GET_VAR 'val tmp_0: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
index: GET_VAR 'val tmp_1: kotlin.Function0<kotlin.Unit> declared in <root>.test2' type=kotlin.Function0<kotlin.Unit> origin=null
other: CONST Int type=kotlin.Int value=42
@@ -255,78 +255,78 @@ FILE fqName:foo fileName:/AssignmentOperator.kt
t: CALL 'public final fun <get-array> (): kotlin.Array<kotlin.Int> declared in foo' type=kotlin.Array<kotlin.Int> origin=GET_PROPERTY
index: CONST Int type=kotlin.Int value=0
value: CONST Int type=kotlin.Int value=10
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Array<kotlin.Int> [val]
CALL 'public final fun id <T> (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array<kotlin.Int> origin=null
<T>: kotlin.Array<kotlin.Int>
t: CALL 'public final fun <get-array> (): kotlin.Array<kotlin.Int> declared in foo' type=kotlin.Array<kotlin.Int> origin=GET_PROPERTY
VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=PLUSEQ
$this: GET_VAR 'val tmp_13: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_14: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=null
value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=PLUSEQ
$this: GET_VAR 'val tmp_13: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_14: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=20
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=MINUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.Array<kotlin.Int> [val]
CALL 'public final fun id <T> (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array<kotlin.Int> origin=null
<T>: kotlin.Array<kotlin.Int>
t: CALL 'public final fun <get-array> (): kotlin.Array<kotlin.Int> declared in foo' type=kotlin.Array<kotlin.Int> origin=GET_PROPERTY
VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=MINUSEQ
$this: GET_VAR 'val tmp_15: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_16: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
value: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=null
value: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MINUSEQ
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=MINUSEQ
$this: GET_VAR 'val tmp_15: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_16: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=20
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=MULTEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Array<kotlin.Int> [val]
CALL 'public final fun id <T> (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array<kotlin.Int> origin=null
<T>: kotlin.Array<kotlin.Int>
t: CALL 'public final fun <get-array> (): kotlin.Array<kotlin.Int> declared in foo' type=kotlin.Array<kotlin.Int> origin=GET_PROPERTY
VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=MULTEQ
$this: GET_VAR 'val tmp_17: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_18: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=null
value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MULTEQ
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=MULTEQ
$this: GET_VAR 'val tmp_17: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_18: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=2
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=DIVEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Array<kotlin.Int> [val]
CALL 'public final fun id <T> (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array<kotlin.Int> origin=null
<T>: kotlin.Array<kotlin.Int>
t: CALL 'public final fun <get-array> (): kotlin.Array<kotlin.Int> declared in foo' type=kotlin.Array<kotlin.Int> origin=GET_PROPERTY
VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=DIVEQ
$this: GET_VAR 'val tmp_19: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_20: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
value: CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=null
value: CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=DIVEQ
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=DIVEQ
$this: GET_VAR 'val tmp_19: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_20: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=5
BLOCK type=kotlin.Unit origin=null
BLOCK type=kotlin.Unit origin=PERCEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Array<kotlin.Int> [val]
CALL 'public final fun id <T> (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array<kotlin.Int> origin=null
<T>: kotlin.Array<kotlin.Int>
t: CALL 'public final fun <get-array> (): kotlin.Array<kotlin.Int> declared in foo' type=kotlin.Array<kotlin.Int> origin=GET_PROPERTY
VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=PERCEQ
$this: GET_VAR 'val tmp_21: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_22: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
value: CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=null
value: CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PERCEQ
$this: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Int origin=PERCEQ
$this: GET_VAR 'val tmp_21: kotlin.Array<kotlin.Int> declared in foo.runMe' type=kotlin.Array<kotlin.Int> origin=null
index: GET_VAR 'val tmp_22: kotlin.Int declared in foo.runMe' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=3
@@ -436,6 +436,11 @@ private class DebugDiagnosticConsumer(
KtFakeSourceElementKind.ArrayIndexExpressionReference,
KtFakeSourceElementKind.DesugaredPrefixNameReference,
KtFakeSourceElementKind.DesugaredPostfixNameReference,
KtFakeSourceElementKind.DesugaredArrayPlusAssign,
KtFakeSourceElementKind.DesugaredArrayMinusAssign,
KtFakeSourceElementKind.DesugaredArrayTimesAssign,
KtFakeSourceElementKind.DesugaredArrayDivAssign,
KtFakeSourceElementKind.DesugaredArrayRemAssign
)
}