diff --git a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FirElementsRecorder.kt b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FirElementsRecorder.kt index 2f535c094dd..70fbb47a676 100644 --- a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FirElementsRecorder.kt +++ b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FirElementsRecorder.kt @@ -129,6 +129,7 @@ internal open class FirElementsRecorder : FirVisitorFoo[1] -= 5 +} + diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayMinusAssignOperatorsInVariousScopes.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayMinusAssignOperatorsInVariousScopes.txt new file mode 100644 index 00000000000..f0c68e76960 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayMinusAssignOperatorsInVariousScopes.txt @@ -0,0 +1,37 @@ +KT element: KtBinaryExpression +FIR element: FirFunctionCallImpl +FIR source kind: DesugaredArrayMinusAssign + +FIR element rendered: +R|/|.R|/set|(R|/|, R|/|.R|/Foo.Companion.get|(R|/|).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 + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Foo.Companion| { + LAZY_super + } + + 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 : R|Foo.Companion| = Q|Foo| + [ResolvedTo(BODY_RESOLVE)] lval : R|kotlin/Int| = Int(1) + R|/|.R|/set|(R|/|, R|/|.R|/Foo.Companion.get|(R|/|).R|kotlin/Int.minus|(Int(5))) + } + + Unit + } \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.kt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.kt new file mode 100644 index 00000000000..7dc59ae1332 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.kt @@ -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) { + bar[1] *= "bar" +} + diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.txt new file mode 100644 index 00000000000..f3e51923e68 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayTimesAssignOperatorsInVariousScopes.txt @@ -0,0 +1,20 @@ +KT element: KtBinaryExpression +FIR element: FirFunctionCallImpl +FIR source kind: DesugaredArrayTimesAssign + +FIR element rendered: +R|/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|/bar|.R|/get|(Int(1)).R|/timesAssign|(String(bar)) + Unit + } diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConvention.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConvention.txt index f5835ec70d6..739292aef40 100644 --- a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConvention.txt +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConvention.txt @@ -1,6 +1,6 @@ KT element: KtBinaryExpression FIR element: FirFunctionCallImpl -FIR source kind: KtRealSourceElementKind +FIR source kind: DesugaredArrayPlusAssign FIR element rendered: R|/|.R|SubstitutionOverride|(R|/|, R|/|.R|SubstitutionOverride|(R|/|).R|kotlin/Int.plus|(Int(1))) diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConventionScript.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConventionScript.txt index 40a4cd156db..940344cc3c4 100644 --- a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConventionScript.txt +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayAccessConventionScript.txt @@ -1,6 +1,6 @@ KT element: KtBinaryExpression FIR element: FirFunctionCallImpl -FIR source kind: KtRealSourceElementKind +FIR source kind: DesugaredArrayPlusAssign FIR element rendered: R|/|.R|SubstitutionOverride|(R|/|, R|/|.R|SubstitutionOverride|(R|/|).R|kotlin/Int.plus|(Int(1))) diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention.txt index 4e80dda0a20..1bee709af9d 100644 --- a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention.txt +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention.txt @@ -1,6 +1,6 @@ KT element: KtBinaryExpression FIR element: FirFunctionCallImpl -FIR source kind: DesugaredCompoundAssignment +FIR source kind: DesugaredArrayPlusAssign FIR element rendered: R|/m|.R|SubstitutionOverride|(String(a)).R|/A.plusAssign|(Int(1)) diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConventionScript.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConventionScript.txt index 73717451108..1c643a6efce 100644 --- a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConventionScript.txt +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConventionScript.txt @@ -1,6 +1,6 @@ KT element: KtBinaryExpression FIR element: FirFunctionCallImpl -FIR source kind: DesugaredCompoundAssignment +FIR source kind: DesugaredArrayPlusAssign FIR element rendered: R|/m|.R|SubstitutionOverride|(String(a)).R|/A.plusAssign|(Int(1)) diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention_lhs.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention_lhs.txt index 7a990780614..01b16d495e8 100644 --- a/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention_lhs.txt +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/calls/compoundAssignWithArrayGetConvention_lhs.txt @@ -1,6 +1,6 @@ KT element: KtArrayAccessExpression FIR element: FirFunctionCallImpl -FIR source kind: KtRealSourceElementKind +FIR source kind: DesugaredArrayPlusAssign FIR element rendered: R|/m|.R|SubstitutionOverride|(String(a)) diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java index dfdd4720789..83c3578ba1c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java @@ -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 { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java index 5252f77ca8f..6eba19ef141 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java @@ -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 { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index b11b11fb214..789d30bbac6 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -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 +) \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 51e18367f97..c44343dce77 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -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 diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 2e354b8070a..7cbd56f9a04 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -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 } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt index 8fae49b6b79..30763201224 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt @@ -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 + }) +} \ No newline at end of file diff --git a/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt b/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt index 26957e7da65..591540b1427 100644 --- a/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt +++ b/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt @@ -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 = b where b will have fake property object ArrayIndexExpressionReference : KtFakeSourceElementKind() diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt index 1c970d50a43..ca5fd81bd4f 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.ir.txt @@ -46,31 +46,31 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt BLOCK_BODY VAR name:x type:kotlin.IntArray [var] CALL 'public final fun foo (): kotlin.IntArray declared in ' 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 .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 .testVariable' type=kotlin.IntArray origin=null index: GET_VAR 'val tmp_1: kotlin.Int declared in .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 .testVariable' type=kotlin.IntArray origin=null index: GET_VAR 'val tmp_1: kotlin.Int declared in .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 ' 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 ' 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 .testCall' type=kotlin.IntArray origin=null index: GET_VAR 'val tmp_3: kotlin.Int declared in .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 .testCall' type=kotlin.IntArray origin=null index: GET_VAR 'val tmp_3: kotlin.Int declared in .testCall' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=2 diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.ir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.ir.txt deleted file mode 100644 index 5649a7efad2..00000000000 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.ir.txt +++ /dev/null @@ -1,57 +0,0 @@ -FILE fqName: fileName:/arrayAugmentedAssignment2.kt - CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA - FUN name:get visibility:public modality:ABSTRACT <> ($this:.IA, index:kotlin.String) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.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: 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: 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: type:kotlin.Any - CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB - FUN name:set visibility:public modality:ABSTRACT <> ($this:.IB, $receiver:.IA, index:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.IB - $receiver: VALUE_PARAMETER name: type:.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: 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: 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: type:kotlin.Any - FUN name:test visibility:public modality:FINAL <> ($receiver:.IB, a:.IA) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.IB - VALUE_PARAMETER name:a index:0 type:.IA - BLOCK_BODY - BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.IA [val] - GET_VAR 'a: .IA declared in .test' type=.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 .IB' type=kotlin.Unit origin=null - $this: GET_VAR ': .IB declared in .test' type=.IB origin=null - $receiver: GET_VAR 'val tmp_0: .IA declared in .test' type=.IA origin=null - index: GET_VAR 'val tmp_1: kotlin.String declared in .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 .IA' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_0: .IA declared in .test' type=.IA origin=null - index: GET_VAR 'val tmp_1: kotlin.String declared in .test' type=kotlin.String origin=null - other: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.kt.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.kt.txt deleted file mode 100644 index f331a774160..00000000000 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.kt.txt +++ /dev/null @@ -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 = "" - (, tmp_0).set(index = tmp_1, value = tmp_0.get(index = tmp_1).plus(other = 42)) - } -} diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.kt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.kt index dd343f8ba0e..31291e1b1c5 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.kt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IA { operator fun get(index: String): Int } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt index 7b685dd99de..7e9899ad259 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.ir.txt @@ -104,7 +104,7 @@ FILE fqName: 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:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Function1 [val] @@ -116,19 +116,19 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int GET_VAR 'p0: kotlin.Int declared in .test1.withVararg' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .test1' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in - CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_0: .A declared in .test1' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_1: kotlin.Function1 declared in .test1' type=kotlin.Function1 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: .IFoo): kotlin.Int declared in ' 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: .IFoo): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_0: .A declared in .test1' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_1: kotlin.Function1 declared in .test1' type=kotlin.Function1 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:.B [val] GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Function1 [val] @@ -140,12 +140,12 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int GET_VAR 'p0: kotlin.Int declared in .test2.withVararg' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in - CALL 'public final fun set (i: .IFoo2, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: .IFoo2, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_2: .B declared in .test2' type=.B origin=null i: TYPE_OP type=.IFoo2 origin=SAM_CONVERSION typeOperand=.IFoo2 GET_VAR 'val tmp_3: kotlin.Function1 declared in .test2' type=kotlin.Function1 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: .IFoo): kotlin.Int declared in ' 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: .IFoo): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_2: .B declared in .test2' type=.B origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_3: kotlin.Function1 declared in .test2' type=kotlin.Function1 origin=null @@ -153,17 +153,17 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt FUN name:test3 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] GET_VAR 'fn: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null - CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_4: .A declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_5: kotlin.Function1 declared in .test3' type=kotlin.Function1 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: .IFoo): kotlin.Int declared in ' 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: .IFoo): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_4: .A declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_5: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null @@ -176,16 +176,16 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.IFoo GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 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:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Any [val] GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null - CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_6: .A declared in .test4' type=.A origin=null i: GET_VAR 'val tmp_7: kotlin.Any declared in .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: .IFoo): kotlin.Int declared in ' 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: .IFoo): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_6: .A declared in .test4' type=.A origin=null i: GET_VAR 'val tmp_7: kotlin.Any declared in .test4' type=kotlin.Any origin=null other: CONST Int type=kotlin.Int value=1 @@ -195,18 +195,18 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .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:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Function1 [val] TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null - CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_8: .A declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_9: kotlin.Function1 declared in .test5' type=kotlin.Function1 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: .IFoo): kotlin.Int declared in ' 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: .IFoo): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_8: .A declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo GET_VAR 'val tmp_9: kotlin.Function1 declared in .test5' type=kotlin.Function1 origin=null @@ -221,16 +221,16 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt TYPE_OP type=.IFoo origin=CAST typeOperand=.IFoo TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .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:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Any [val] GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null - CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_10: .A declared in .test6' type=.A origin=null i: GET_VAR 'val tmp_11: kotlin.Any declared in .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: .IFoo): kotlin.Int declared in ' 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: .IFoo): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_10: .A declared in .test6' type=.A origin=null i: GET_VAR 'val tmp_11: kotlin.Any declared in .test6' type=kotlin.Any origin=null other: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt index ffb83a6b331..0dcb3169f92 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.fir.ir.txt @@ -65,19 +65,19 @@ FILE fqName: fileName:/kt28456.kt FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] GET_VAR 'a: .A declared in .testCompoundAssignment' type=.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 ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_4: .A declared in .testCompoundAssignment' type=.A origin=null i: GET_VAR 'val tmp_5: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null j: GET_VAR 'val tmp_6: kotlin.Int declared in .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 ' 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 ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_4: .A declared in .testCompoundAssignment' type=.A origin=null xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int GET_VAR 'val tmp_5: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt index cd90c82862a..b401c976418 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.fir.ir.txt @@ -73,16 +73,16 @@ FILE fqName: fileName:/kt28456b.kt FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.A [val] GET_VAR 'a: .A declared in .testCompoundAssignment' type=.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 ' type=kotlin.Unit origin=null + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_3: .A declared in .testCompoundAssignment' type=.A origin=null i: GET_VAR 'val tmp_4: kotlin.Int declared in .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 ' 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 ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_3: .A declared in .testCompoundAssignment' type=.A origin=null i: GET_VAR 'val tmp_4: kotlin.Int declared in .testCompoundAssignment' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=10 diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt index 92069b1f574..d9197985274 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.ir.txt @@ -27,7 +27,7 @@ FILE fqName: 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 .test2' type=kotlin.Any origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Function0 [val] @@ -36,11 +36,11 @@ FILE fqName: fileName:/lambdaInCAO.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .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, value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set (index: kotlin.Function0, value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val tmp_0: kotlin.Any declared in .test2' type=kotlin.Any origin=null index: GET_VAR 'val tmp_1: kotlin.Function0 declared in .test2' type=kotlin.Function0 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.Int declared in ' 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.Int declared in ' type=kotlin.Int origin=PLUSEQ $receiver: GET_VAR 'val tmp_0: kotlin.Any declared in .test2' type=kotlin.Any origin=null index: GET_VAR 'val tmp_1: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null other: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt index 4dbd6bc4f2c..afff7eed5e4 100644 --- a/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AssignmentOperator.fir.ir.txt @@ -255,78 +255,78 @@ FILE fqName:foo fileName:/AssignmentOperator.kt t: CALL 'public final fun (): kotlin.Array declared in foo' type=kotlin.Array 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 [val] CALL 'public final fun id (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array origin=null : kotlin.Array t: CALL 'public final fun (): kotlin.Array declared in foo' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 [val] CALL 'public final fun id (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array origin=null : kotlin.Array t: CALL 'public final fun (): kotlin.Array declared in foo' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 [val] CALL 'public final fun id (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array origin=null : kotlin.Array t: CALL 'public final fun (): kotlin.Array declared in foo' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 [val] CALL 'public final fun id (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array origin=null : kotlin.Array t: CALL 'public final fun (): kotlin.Array declared in foo' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 [val] CALL 'public final fun id (t: T of foo.id): T of foo.id declared in foo' type=kotlin.Array origin=null : kotlin.Array t: CALL 'public final fun (): kotlin.Array declared in foo' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 declared in foo.runMe' type=kotlin.Array 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 diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt index bc05c584d9a..9065795c12d 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt @@ -436,6 +436,11 @@ private class DebugDiagnosticConsumer( KtFakeSourceElementKind.ArrayIndexExpressionReference, KtFakeSourceElementKind.DesugaredPrefixNameReference, KtFakeSourceElementKind.DesugaredPostfixNameReference, + KtFakeSourceElementKind.DesugaredArrayPlusAssign, + KtFakeSourceElementKind.DesugaredArrayMinusAssign, + KtFakeSourceElementKind.DesugaredArrayTimesAssign, + KtFakeSourceElementKind.DesugaredArrayDivAssign, + KtFakeSourceElementKind.DesugaredArrayRemAssign ) }