diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt index c5853d61fed..6d3bf461c95 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt @@ -705,9 +705,8 @@ internal class KtFirCallResolver( val setPartiallyAppliedSymbol = fir.toPartiallyAppliedSymbol(arrayAccessExpression.arrayExpression) ?: return null return when (incDecPrecedence) { KtCompoundAccess.IncOrDecOperation.Precedence.PREFIX -> { - // For prefix case, the last argument is a reference to a synthetic local variable `` storing the result. So - // we find the inc or dec operation call from the initializer of this local variable. - val operationCall = getInitializerOfReferencedLocalVariable(lastArg) ?: return null + // For prefix case, the last argument is a call to get(...).inc(). + val operationCall = lastArg as? FirFunctionCall ?: return null val operationPartiallyAppliedSymbol = operationCall.toPartiallyAppliedSymbol(arrayAccessExpression) ?: return null // The get call is the explicit receiver of this operation call val getCall = operationCall.explicitReceiver as? FirFunctionCall ?: return null diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 968b630588f..37b564f6fd3 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -711,6 +711,18 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/PackageQualified.kt"); } + @Test + @TestMetadata("prefixIncReturnType.kt") + public void testPrefixIncReturnType() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncReturnType.kt"); + } + + @Test + @TestMetadata("prefixIncSmartCast.kt") + public void testPrefixIncSmartCast() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncSmartCast.kt"); + } + @Test @TestMetadata("PrimaryConstructors.kt") public void testPrimaryConstructors() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 0826b129dbf..da8fbfa3328 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -711,6 +711,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/PackageQualified.kt"); } + @Test + @TestMetadata("prefixIncReturnType.kt") + public void testPrefixIncReturnType() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncReturnType.kt"); + } + + @Test + @TestMetadata("prefixIncSmartCast.kt") + public void testPrefixIncSmartCast() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncSmartCast.kt"); + } + @Test @TestMetadata("PrimaryConstructors.kt") public void testPrimaryConstructors() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 7506f7a397f..fad969c1d91 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -711,6 +711,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/PackageQualified.kt"); } + @Test + @TestMetadata("prefixIncReturnType.kt") + public void testPrefixIncReturnType() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncReturnType.kt"); + } + + @Test + @TestMetadata("prefixIncSmartCast.kt") + public void testPrefixIncSmartCast() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncSmartCast.kt"); + } + @Test @TestMetadata("PrimaryConstructors.kt") public void testPrimaryConstructors() throws Exception { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index a5aa4da0f65..a64bab199c3 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -141,6 +141,12 @@ class ErrorNodeDiagnosticCollectorComponent( // See FirForLoopChecker return } + + // Prefix inc/dec on array access will have two calls to .get(...), don't report for the second one. + if (source.kind == KtFakeSourceElementKind.DesugaredPrefixSecondGetReference) { + return + } + for (coneDiagnostic in diagnostic.toFirDiagnostics(session, source, qualifiedAccessSource)) { reporter.report(coneDiagnostic, context) } 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 363fcf0aece..73b97a1cae9 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 @@ -653,6 +653,13 @@ class Fir2IrVisitor( return callGenerator.convertToIrSetCall(variableAssignment, explicitReceiverExpression) } + override fun visitDesugaredAssignmentValueReferenceExpression( + desugaredAssignmentValueReferenceExpression: FirDesugaredAssignmentValueReferenceExpression, + data: Any? + ): IrElement { + return desugaredAssignmentValueReferenceExpression.expressionRef.value.accept(this, null) + } + override fun visitConstExpression(constExpression: FirConstExpression, data: Any?): IrElement { return constExpression.toIrConst(constExpression.typeRef.toIrType()) } diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 81e9efec15c..18588a37a07 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -26933,12 +26933,6 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -49309,24 +49303,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index b908f479f6c..c21cf26d068 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -26933,12 +26933,6 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -49309,24 +49303,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/safeCallsWithUnaryOperators.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/safeCallsWithUnaryOperators.txt index 5e12e381a03..a620087891c 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/safeCallsWithUnaryOperators.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/safeCallsWithUnaryOperators.txt @@ -54,44 +54,38 @@ FILE: safeCallsWithUnaryOperators.kt a#?.{ { lval : = $subj$.b# lval : = IntegerLiteral(0) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) } } a#?.{ $subj$.b# }?.{ { lval : = $subj$.c# lval : = IntegerLiteral(0) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) } } lval : = a#?.{ $subj$.b# }.c# lval : = IntegerLiteral(0) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) a#?.{ { lval : = $subj$.b#.get#(IntegerLiteral(0)) lval : = IntegerLiteral(0) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) } } a#?.{ $subj$.b# }?.{ { lval : = $subj$.c#.get#(IntegerLiteral(0)) lval : = IntegerLiteral(0) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) } } lval : = a#?.{ $subj$.b# }.c#.get#(IntegerLiteral(0)) lval : = IntegerLiteral(0) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) ++a#?.{ $subj$.b# }.d#() } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/unary.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/unary.txt index 4c3a994eb4a..d7a635cbf38 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/unary.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/unary.txt @@ -37,9 +37,8 @@ FILE: unary.kt lval x2: = { lval : = arr# lval : = IntegerLiteral(1) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) } } @@ -64,9 +63,8 @@ FILE: unary.kt lval x2: = { lval : = y#.arr# lval : = IntegerLiteral(1) - lval : = R|/|.get#(R|/|).inc#() - R|/|.set#(R|/|, R|/|) - R|/| + R|/|.set#(R|/|, R|/|.get#(R|/|).inc#()) + R|/|.get#(R|/|) } } diff --git a/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/BaseFirBuilder.kt b/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/BaseFirBuilder.kt index 2b02333d40a..f46d391a9fa 100644 --- a/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/BaseFirBuilder.kt +++ b/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/BaseFirBuilder.kt @@ -471,32 +471,6 @@ abstract class BaseFirBuilder(val baseSession: FirSession, val context: Conte } } - /** - * given: - * receiver++ - * - * result: - * { - * val = receiver - * receiver = .inc() - * ^ - * } - * - * given: - * ++receiver - * - * result: - * { - * val = receiver.inc() - * receiver = - * ^ - * } - * - */ - - // TODO: - // 1. Support receiver capturing for `a?.b++` (elementType == SAFE_ACCESS_EXPRESSION). - // 2. Add box test cases for #1 where receiver expression has side effects. fun generateIncrementOrDecrementBlock( // Used to obtain source-element or text wholeExpression: T, @@ -532,91 +506,6 @@ abstract class BaseFirBuilder(val baseSession: FirSession, val context: Conte } - /** - * given: - * receiver++ - * - * result: - * { - * val = receiver - * val resultVar = .inc() - * appendAssignment(resultVar) - * ^ - * } - * - * given: - * ++receiver - * - * result: - * { - * val = receiver.inc() - * val resultVar = - * appendAssignment(resultVar) - * ^ - * } - * - */ - private fun FirBlockBuilder.putIncrementOrDecrementStatements( - receiver: FirExpression, - operationReference: T?, - callName: Name, // 'inc' or 'dec' - prefix: Boolean, - nameIfSimpleReference: Name?, // 'b' if whole expression is simple `b++` or `a.b++`, but not `a[1]++` - desugaredSource: KtSourceElement?, - appendAssignment: FirBlockBuilder.(resultInitializer: FirExpression, resultVar: FirVariable) -> Unit - ) { - // initialValueVar is only used for postfix increment/decrement (stores the argument value before increment/decrement). - val initialValueVar = generateTemporaryVariable( - baseModuleData, - desugaredSource, - SpecialNames.UNARY, - receiver - ) - - // resultInitializer is the expression for `argument.inc()` - val resultInitializer = buildFunctionCall { - source = desugaredSource - calleeReference = buildSimpleNamedReference { - val kind = if (prefix) { - KtFakeSourceElementKind.DesugaredPrefixNameReference - } else { - KtFakeSourceElementKind.DesugaredPostfixNameReference - } - source = operationReference?.toFirSourceElement(kind) - name = callName - } - explicitReceiver = if (prefix) { - receiver - } else { - generateResolvedAccessExpression(desugaredSource, initialValueVar) - } - origin = FirFunctionCallOrigin.Operator - } - - // resultVar is only used for prefix increment/decrement. - val resultVar = generateTemporaryVariable( - baseModuleData, - desugaredSource, - SpecialNames.UNARY_RESULT, - resultInitializer - ) - - if (prefix) { - if (nameIfSimpleReference != null) { - appendAssignment(resultInitializer, resultVar) - statements += generateAccessExpression(desugaredSource, desugaredSource, nameIfSimpleReference) - } else { - statements += resultVar - appendAssignment(resultInitializer, resultVar) - statements += generateResolvedAccessExpression(desugaredSource, resultVar) - } - } else { - statements += initialValueVar - appendAssignment(resultInitializer, resultVar) - statements += generateResolvedAccessExpression(desugaredSource, initialValueVar) - } - } - private fun T?.unwrap(): T? { // NOTE: By removing surrounding parentheses and labels, FirLabels will NOT be created for those labels. // This should be fine since the label is meaningless and unusable for a ++/-- argument or assignment LHS. @@ -653,9 +542,8 @@ abstract class BaseFirBuilder(val baseSession: FirSession, val context: Conte * val = a * val = b * val = c - * val = .get(b, c).inc() - * .set(b, c, ) - * ^ + * .set(b, c, .get(b, c).inc()) + * ^.get(b, c) * } * */ @@ -668,7 +556,7 @@ abstract class BaseFirBuilder(val baseSession: FirSession, val context: Conte convert: T.() -> FirExpression ): FirExpression { val array = receiver.arrayExpression - return buildBlockProbablyUnderSafeCall( + return buildBlockPossiblyUnderSafeCall( array, convert, receiver.toFirSourceElement(), ) { arrayReceiver -> val baseSource = wholeExpression?.toFirSourceElement() @@ -694,44 +582,74 @@ abstract class BaseFirBuilder(val baseSession: FirSession, val context: Conte ).also { statements += it } } - val firArgument = buildFunctionCall { - source = desugaredSource - calleeReference = buildSimpleNamedReference { - source = receiver?.toFirSourceElement(KtFakeSourceElementKind.ArrayAccessNameReference) - name = OperatorNameConventions.GET - } - explicitReceiver = generateResolvedAccessExpression(arrayVariable.source, arrayVariable) - argumentList = buildArgumentList { - for (indexVar in indexVariables) { - arguments += generateResolvedAccessExpression(indexVar.source, indexVar) - } - } - origin = FirFunctionCallOrigin.Operator - } - - putIncrementOrDecrementStatements( - firArgument, operationReference, callName, prefix, - nameIfSimpleReference = null, desugaredSource - ) { resultInitializer: FirExpression, resultVar: FirVariable -> - statements += buildFunctionCall { + fun buildGetCall(referenceSourceKind: KtFakeSourceElementKind = KtFakeSourceElementKind.ArrayAccessNameReference) = + buildFunctionCall { source = desugaredSource calleeReference = buildSimpleNamedReference { - source = receiver.toFirSourceElement() - name = OperatorNameConventions.SET + source = receiver?.toFirSourceElement(referenceSourceKind) + name = OperatorNameConventions.GET } explicitReceiver = generateResolvedAccessExpression(arrayVariable.source, arrayVariable) argumentList = buildArgumentList { for (indexVar in indexVariables) { arguments += generateResolvedAccessExpression(indexVar.source, indexVar) } - arguments += if (prefix) { - generateResolvedAccessExpression(source, resultVar) - } else { - resultInitializer - } } origin = FirFunctionCallOrigin.Operator } + + fun buildSetCall(argumentExpression: FirExpression) = buildFunctionCall { + source = desugaredSource + calleeReference = buildSimpleNamedReference { + source = receiver.toFirSourceElement() + name = OperatorNameConventions.SET + } + explicitReceiver = generateResolvedAccessExpression(arrayVariable.source, arrayVariable) + argumentList = buildArgumentList { + for (indexVar in indexVariables) { + arguments += generateResolvedAccessExpression(indexVar.source, indexVar) + } + arguments += argumentExpression + } + origin = FirFunctionCallOrigin.Operator + } + + fun buildIncDecCall(kind: KtFakeSourceElementKind, receiver: FirExpression) = buildFunctionCall { + source = desugaredSource + calleeReference = buildSimpleNamedReference { + source = operationReference?.toFirSourceElement(kind) + name = callName + } + explicitReceiver = receiver + origin = FirFunctionCallOrigin.Operator + } + + if (prefix) { + statements += buildSetCall( + buildIncDecCall( + KtFakeSourceElementKind.DesugaredPrefixNameReference, + buildGetCall() + ) + ) + + statements += buildGetCall(KtFakeSourceElementKind.DesugaredPrefixSecondGetReference) + } else { + val initialValueVar = generateTemporaryVariable( + baseModuleData, + desugaredSource, + SpecialNames.UNARY, + buildGetCall() + ) + + statements += initialValueVar + + statements += buildSetCall( + buildIncDecCall( + KtFakeSourceElementKind.DesugaredPostfixNameReference, + generateResolvedAccessExpression(desugaredSource, initialValueVar) + ) + ) + statements += generateResolvedAccessExpression(desugaredSource, initialValueVar) } } } @@ -741,7 +659,7 @@ abstract class BaseFirBuilder(val baseSession: FirSession, val context: Conte // a?.{ val receiver = $subj$.f() ... } where `...` is generated by `init(FIR<$subj$.f()>)` // // Otherwise just returns buildBlock { init(FIR)) } - private fun buildBlockProbablyUnderSafeCall( + private fun buildBlockPossiblyUnderSafeCall( receiver: T?, convert: T.() -> FirExpression, sourceElementForError: KtSourceElement?, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt index d7bdee3032d..62b9aa8d1fb 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt @@ -391,6 +391,16 @@ fun BodyResolveComponents.transformWhenSubjectExpressionUsingSmartcastInfo( return builder.build() } +fun BodyResolveComponents.transformDesugaredAssignmentValueUsingSmartcastInfo( + expression: FirDesugaredAssignmentValueReferenceExpression +): FirExpression { + val (stability, typesFromSmartCast) = dataFlowAnalyzer.getTypeUsingSmartcastInfo(expression.expressionRef.value) ?: return expression + val builder = transformExpressionUsingSmartcastInfo( + expression, stability, typesFromSmartCast + ) ?: return expression + return builder.build() +} + private val ConeKotlinType.isKindOfNothing get() = lowerBoundIfFlexible().let { it.isNothing || it.isNullableNothing } 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 b1a0df7c2cc..94abf66b9bb 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 @@ -750,26 +750,16 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT } if (incrementDecrementExpression.isPrefix) { - val targetProperty = expression.calleeReference?.toResolvedPropertySymbol()?.fir - val operatorCall = buildAndResolveOperatorCall(expression) - - // Special case for prefix inc/dec on local variable without delegate where unary-result variable generation is skipped. - if (targetProperty?.isLocal == true && targetProperty.delegate == null) { - // a = a.inc() - statements += buildAndResolveVariableAssignment(operatorCall) - // ^a - statements += targetProperty.toQualifiedAccess(fakeSource = desugaredSource, typeRef = noExpectedType) - // If inc() returns a subtype of its receiver type, the variable access should be smart-casted. - .transform(transformer, withExpectedType(operatorCall.typeRef.coneType)) - } else { - val unaryResultVariable = generateTemporaryVariable(SpecialNames.UNARY_RESULT, operatorCall) - - // val = a.inc() - statements += unaryResultVariable - // a = - statements += buildAndResolveVariableAssignment(unaryResultVariable.toQualifiedAccess(fakeSource = desugaredSource)) - // ^ - statements += unaryResultVariable.toQualifiedAccess(fakeSource = desugaredSource) + // a = a.inc() + statements += buildAndResolveVariableAssignment(buildAndResolveOperatorCall(expression)) + // ^a + statements += buildDesugaredAssignmentValueReferenceExpression { + source = ((expression as? FirErrorExpression)?.expression ?: expression).source + ?.fakeElement(KtFakeSourceElementKind.DesugaredIncrementOrDecrement) + expressionRef = FirExpressionRef().apply { bind(expression.unwrapSmartcastExpression()) } + }.let { + it.transform(transformer, ResolutionMode.ContextIndependent) + components.transformDesugaredAssignmentValueUsingSmartcastInfo(it) } } else { val unaryVariable = generateTemporaryVariable(SpecialNames.UNARY, expression) diff --git a/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt b/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt index 8329e9920fa..2c23d80fc27 100644 --- a/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt +++ b/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt @@ -133,6 +133,9 @@ sealed class KtFakeSourceElementKind(final override val shouldSkipErrorTypeRepor // x = x++ -> x = { val = x; x = .inc(); } object DesugaredIncrementOrDecrement : KtFakeSourceElementKind() + // In ++a[1], a.get(1) will be called twice. This kind is used for the second call reference. + object DesugaredPrefixSecondGetReference : KtFakeSourceElementKind() + // ++x --> `inc` calleeReference object DesugaredPrefixNameReference : KtFakeSourceElementKind() diff --git a/compiler/testData/codegen/box/defaultArguments/convention/incWithDefaultInGetter.kt b/compiler/testData/codegen/box/defaultArguments/convention/incWithDefaultInGetter.kt index 4a80a8741c9..edf169a4a57 100644 --- a/compiler/testData/codegen/box/defaultArguments/convention/incWithDefaultInGetter.kt +++ b/compiler/testData/codegen/box/defaultArguments/convention/incWithDefaultInGetter.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE -// FIR status: don't support legacy feature (prefix increment calls getter twice). fail 2: anone1 var inc: String = "" class X { @@ -25,4 +23,4 @@ fun box(): String { if (res != "aanone1none") return "fail 2: ${res}" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/increment/argumentWithSideEffects.kt b/compiler/testData/codegen/box/increment/argumentWithSideEffects.kt index b0f4191fa74..8eb2d1db92c 100644 --- a/compiler/testData/codegen/box/increment/argumentWithSideEffects.kt +++ b/compiler/testData/codegen/box/increment/argumentWithSideEffects.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE -// FIR status: don't support legacy feature; questionable test, probably should not support. -// Currently fails because prefix increment only calls getter once. var log = "" fun logged(value: T): T = diff --git a/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt b/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt index 074e9df8e47..2926b08ee94 100644 --- a/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt +++ b/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND_K2: ANY -// Behavior changed in K2, see KT-42077 - public var inc: Int = 0 public var propInc: Int = 0 diff --git a/compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt b/compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt deleted file mode 100644 index fc734d42c24..00000000000 --- a/compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt +++ /dev/null @@ -1,34 +0,0 @@ -// IGNORE_BACKEND_K1: ANY -// Behavior changed in K2, see KT-42077 -// IGNORE_BACKEND: WASM -// SKIP_NODE_JS - -public var inc: Int = 0 - -public var propInc: Int = 0 - get() {++inc; return field} - set(a: Int) { - ++inc - field = a - } - -public var dec: Int = 0 - -public var propDec: Int = 0 - get() { --dec; return field} - set(a: Int) { - --dec - field = a - } - -fun box(): String { - ++propInc - if (inc != 2) return "fail in prefix increment: ${inc} != 2" - if (propInc != 1) return "fail in prefix increment: ${propInc} != 1" - - --propDec - if (dec != -2) return "fail in prefix decrement: ${dec} != -2" - if (propDec != -1) return "fail in prefix decrement: ${propDec} != -1" - - return "OK" -} diff --git a/compiler/testData/codegen/box/statics/incInClassObject.kt b/compiler/testData/codegen/box/statics/incInClassObject.kt index a67d2c25236..38ad4f1700b 100644 --- a/compiler/testData/codegen/box/statics/incInClassObject.kt +++ b/compiler/testData/codegen/box/statics/incInClassObject.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND_K2: ANY -// Behavior changed in K2, see KT-42077 - class A { companion object { private var r: Int = 1; diff --git a/compiler/testData/codegen/box/statics/incInClassObjectFir.kt b/compiler/testData/codegen/box/statics/incInClassObjectFir.kt deleted file mode 100644 index 996b86ed9e3..00000000000 --- a/compiler/testData/codegen/box/statics/incInClassObjectFir.kt +++ /dev/null @@ -1,78 +0,0 @@ -// IGNORE_BACKEND_K1: ANY -// Behavior changed in K2, see KT-42077 -// IGNORE_BACKEND: WASM -// SKIP_NODE_JS - -class A { - companion object { - private var r: Int = 1; - - fun test(): Int { - r++ - ++r - return r - } - - var holder: String = "" - - var r2: Int = 1 - get() { - holder += "getR2" - return field - } - - fun test2() : Int { - r2++ - ++r2 - return r2 - } - - var r3: Int = 1 - set(p: Int) { - holder += "setR3" - field = p - } - - fun test3() : Int { - r3++ - ++r3 - return r3 - } - - var r4: Int = 1 - get() { - holder += "getR4" - return field - } - set(p: Int) { - holder += "setR4" - field = p - } - - fun test4() : Int { - r4++ - holder += ":" - ++r4 - return r4 - } - } -} - -fun box() : String { - val p = A.test() - if (p != 3) return "fail 1: $p" - - val p2 = A.test2() - var holderValue = A.holder - if (p2 != 3 || holderValue != "getR2getR2getR2") return "fail 2: $p2 ${holderValue}" - - A.holder = "" - val p3 = A.test3() - if (p3 != 3 || A.holder != "setR3setR3") return "fail 3: $p3 ${A.holder}" - - A.holder = "" - val p4 = A.test4() - if (p4 != 3 || A.holder != "getR4setR4:getR4setR4getR4") return "fail 4: $p4 ${A.holder}" - - return "OK" -} diff --git a/compiler/testData/codegen/box/statics/incInObject.kt b/compiler/testData/codegen/box/statics/incInObject.kt index b655596ddbd..b88fd970144 100644 --- a/compiler/testData/codegen/box/statics/incInObject.kt +++ b/compiler/testData/codegen/box/statics/incInObject.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND_K2: ANY -// Behavior changed in K2, see KT-42077 - object A { private var r: Int = 1; diff --git a/compiler/testData/codegen/box/statics/incInObjectFir.kt b/compiler/testData/codegen/box/statics/incInObjectFir.kt deleted file mode 100644 index d97f9bd294f..00000000000 --- a/compiler/testData/codegen/box/statics/incInObjectFir.kt +++ /dev/null @@ -1,76 +0,0 @@ -// IGNORE_BACKEND_K1: ANY -// Behavior changed in K2, see KT-42077 -// IGNORE_BACKEND: WASM -// SKIP_NODE_JS - -object A { - private var r: Int = 1; - - fun test() : Int { - r++ - ++r - return r - } - - var holder: String = "" - - var r2: Int = 1 - get() { - holder += "getR2" - return field - } - - fun test2() : Int { - r2++ - ++r2 - return r2 - } - - var r3: Int = 1 - set(p: Int) { - holder += "setR3" - field = p - } - - fun test3() : Int { - r3++ - ++r3 - return r3 - } - - var r4: Int = 1 - get() { - holder += "getR4" - return field - } - set(p: Int) { - holder += "setR4" - field = p - } - - fun test4() : Int { - r4++ - holder += ":" - ++r4 - return r4 - } -} - -fun box() : String { - val p = A.test() - if (p != 3) return "fail 1: $p" - - val p2 = A.test2() - val holderValue = A.holder - if (p2 != 3 || holderValue != "getR2getR2getR2") return "fail 2: $p2 ${holderValue}" - - A.holder = "" - val p3 = A.test3() - if (p3 != 3 || A.holder != "setR3setR3") return "fail 3: $p3 ${A.holder}" - - A.holder = "" - val p4 = A.test4() - if (p4 != 3 || A.holder != "getR4setR4:getR4setR4getR4") return "fail 4: $p4 ${A.holder}" - - return "OK" -} diff --git a/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtension.kt b/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtension.kt index 69c935c5133..2d1038a210b 100644 --- a/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtension.kt +++ b/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtension.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE -// IGNORE_BACKEND_K2_MULTI_MODULE: JVM_IR JVM_IR_SERIALIZE // FILE: 1.kt package test diff --git a/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtensionInClass.kt b/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtensionInClass.kt index f8bdf6bdd60..c03b796a926 100644 --- a/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtensionInClass.kt +++ b/compiler/testData/codegen/boxInline/property/augAssignmentAndIncOnExtensionInClass.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE -// IGNORE_BACKEND_K2_MULTI_MODULE: JVM_IR JVM_IR_SERIALIZE // FILE: 1.kt package test diff --git a/compiler/testData/diagnostics/tests/IncDec.fir.kt b/compiler/testData/diagnostics/tests/IncDec.fir.kt deleted file mode 100644 index 21c5597f2c0..00000000000 --- a/compiler/testData/diagnostics/tests/IncDec.fir.kt +++ /dev/null @@ -1,46 +0,0 @@ -class IncDec() { - operator fun inc() : IncDec = this - operator fun dec() : IncDec = this -} - -fun testIncDec() { - var x = IncDec() - x++ - ++x - x-- - --x - x = x++ - x = x-- - x = ++x - x = --x -} - -class WrongIncDec() { - operator fun inc() : Int = 1 - operator fun dec() : Int = 1 -} - -fun testWrongIncDec() { - var x = WrongIncDec() - x++ - ++x - x-- - --x -} - -class UnitIncDec() { - operator fun inc() : Unit {} - operator fun dec() : Unit {} -} - -fun testUnitIncDec() { - var x = UnitIncDec() - x++ - ++x - x-- - --x - x = x++ - x = x-- - x = ++x - x = --x -} diff --git a/compiler/testData/diagnostics/tests/IncDec.kt b/compiler/testData/diagnostics/tests/IncDec.kt index 16e4ec01f1e..19cc115b2d3 100644 --- a/compiler/testData/diagnostics/tests/IncDec.kt +++ b/compiler/testData/diagnostics/tests/IncDec.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class IncDec() { operator fun inc() : IncDec = this operator fun dec() : IncDec = this diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt index 8cf34a1bfa6..2d9add4f19a 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt @@ -18,7 +18,7 @@ object MismatchingTypes { } fun testMismatchingTypes() { - ++MismatchingTypes[0] + ++MismatchingTypes[0] MismatchingTypes[0]++ MismatchingTypes[0] += 1 } diff --git a/compiler/testData/diagnostics/tests/prefixIncReturnType.fir.kt b/compiler/testData/diagnostics/tests/prefixIncReturnType.fir.kt new file mode 100644 index 00000000000..ecc742e8556 --- /dev/null +++ b/compiler/testData/diagnostics/tests/prefixIncReturnType.fir.kt @@ -0,0 +1,15 @@ +// Breaking change in K2, see KT-57178 + +open class I { + operator fun inc(): ST = ST() +} + +class ST : I() + +var topLevel: I + get() = I() + set(value) {} + +fun main() { + val x: ST = ++topLevel +} diff --git a/compiler/testData/diagnostics/tests/prefixIncReturnType.kt b/compiler/testData/diagnostics/tests/prefixIncReturnType.kt new file mode 100644 index 00000000000..a25640f6d1d --- /dev/null +++ b/compiler/testData/diagnostics/tests/prefixIncReturnType.kt @@ -0,0 +1,15 @@ +// Breaking change in K2, see KT-57178 + +open class I { + operator fun inc(): ST = ST() +} + +class ST : I() + +var topLevel: I + get() = I() + set(value) {} + +fun main() { + val x: ST = ++topLevel +} diff --git a/compiler/testData/diagnostics/tests/prefixIncSmartCast.fir.kt b/compiler/testData/diagnostics/tests/prefixIncSmartCast.fir.kt new file mode 100644 index 00000000000..cd6494bbb13 --- /dev/null +++ b/compiler/testData/diagnostics/tests/prefixIncSmartCast.fir.kt @@ -0,0 +1,13 @@ +// Changed in K2, see KT-57178 + +open class I { + operator fun inc(): ST = ST() +} + +class ST : I() + +fun main() { + var local = I() + val x: ST = ++local + val y: ST = local +} diff --git a/compiler/testData/diagnostics/tests/prefixIncSmartCast.kt b/compiler/testData/diagnostics/tests/prefixIncSmartCast.kt new file mode 100644 index 00000000000..02b794e89b3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/prefixIncSmartCast.kt @@ -0,0 +1,13 @@ +// Changed in K2, see KT-57178 + +open class I { + operator fun inc(): ST = ST() +} + +class ST : I() + +fun main() { + var local = I() + val x: ST = ++local + val y: ST = local +} diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt index b6cdda570b5..9ba44ace8dd 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.ir.txt @@ -27,6 +27,104 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:private [final,static]' type=kotlin.IntArray origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + FUN name:get visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' + GET_VAR 'i: kotlin.Int declared in .C.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + 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 [operator] 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 OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O + CONSTRUCTOR visibility:private <> () returnType:.O [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.O + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .O' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + value: GET_VAR ': kotlin.Int declared in .O.' type=kotlin.Int origin=null + FUN name:get visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' + GET_VAR 'i: kotlin.Int declared in .O.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + 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 [operator] 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:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.Int [var] @@ -67,103 +165,327 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK_BODY VAR name:p1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] - CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] - CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : GET_VAR 'val tmp_3: kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:p1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_3: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.IntArray [val] + CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_4: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val] - CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null - value: GET_VAR 'val tmp_8: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null - GET_VAR 'val tmp_8: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null - VAR name:a2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.IntArray [val] - CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Int [val] - CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_9: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_10: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null - CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_9: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_10: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null - value: GET_VAR 'val tmp_11: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null - GET_VAR 'val tmp_11: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_12: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_13: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_8: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_12: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_13: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_8: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_14: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_14: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_10: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_10: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_15: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_16: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_11: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_12: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_15: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_16: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_11: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_12: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_17: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_17: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_13: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_13: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + FUN name:testClassPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'val tmp_14: .C [val] declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val tmp_14: .C [val] declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val tmp_14: .C [val] declared in .testClassPropPrefix' type=.C origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'val tmp_15: .C [val] declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val tmp_15: .C [val] declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val tmp_15: .C [val] declared in .testClassPropPrefix' type=.C origin=null + FUN name:testClassPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val tmp_16: .C [val] declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'val tmp_16: .C [val] declared in .testClassPropPostfix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_17: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_17: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val tmp_18: .C [val] declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'val tmp_18: .C [val] declared in .testClassPropPostfix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_19: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_19: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + FUN name:testClassOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_20: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_21: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_20: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_21: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_20: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_21: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_22: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_23: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_22: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_23: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_22: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_23: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + FUN name:testClassOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_24: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_25: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_24: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_25: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_26: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_26: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_28 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_29 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_27: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_28: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_27: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_28: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_29: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_29: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + FUN name:testObjectPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + FUN name:testObjectPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_30 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_30: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_30: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_31 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_31: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_31: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + FUN name:testObjectOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_32 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_33 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_32: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_33: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_32: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_33: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_32: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_33: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_34 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_35 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_34: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_35: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_34: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_35: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_34: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_35: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + FUN name:testObjectOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_36 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_37 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_38 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_36: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_37: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_36: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_37: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_38: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_38: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_39 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_40 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_41 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_39: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_40: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_39: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_40: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_41: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_41: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt index fc3fe903eda..c5442683495 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.kt.txt @@ -7,6 +7,48 @@ val arr: IntArray field = intArrayOf(elements = [1, 2, 3]) get +class C { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + var p: Int + field = 0 + get + set + + operator fun get(i: Int): Int { + return i + } + + operator fun set(i: Int, value: Int) { + } + +} + +object O { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + var p: Int + field = 0 + get + set + + operator fun get(i: Int): Int { + return i + } + + operator fun set(i: Int, value: Int) { + } + +} + fun testVarPrefix() { var x: Int = 0 val x1: Int = { // BLOCK @@ -35,14 +77,12 @@ fun testVarPostfix() { fun testPropPrefix() { val p1: Int = { // BLOCK - val : Int = ().inc() - ( = ) - + ( = ().inc()) + () } val p2: Int = { // BLOCK - val : Int = ().dec() - ( = ) - + ( = ().dec()) + () } } @@ -53,9 +93,9 @@ fun testPropPostfix() { } val p2: Int = { // BLOCK - val : Int = ().dec() - ( = ) - + val : Int = () + ( = .dec()) + } } @@ -63,16 +103,14 @@ fun testArrayPrefix() { val a1: Int = { // BLOCK val : IntArray = () val : Int = 0 - val : Int = .get(index = ).inc() - .set(index = , value = ) - + .set(index = , value = .get(index = ).inc()) + .get(index = ) } val a2: Int = { // BLOCK val : IntArray = () val : Int = 0 - val : Int = .get(index = ).dec() - .set(index = , value = ) - + .set(index = , value = .get(index = ).dec()) + .get(index = ) } } @@ -92,3 +130,119 @@ fun testArrayPostfix() { } } + +fun testClassPropPrefix() { + val p1: Int = { // BLOCK + val : C = C() + .( = .().inc()) + .() + } + val p2: Int = { // BLOCK + val : C = C() + .( = .().dec()) + .() + } +} + +fun testClassPropPostfix() { + val p1: Int = { // BLOCK + val : C = C() + val : Int = .() + .( = .inc()) + + } + val p2: Int = { // BLOCK + val : C = C() + val : Int = .() + .( = .dec()) + + } +} + +fun testClassOperatorPrefix() { + val a1: Int = { // BLOCK + val : C = C() + val : Int = 0 + .set(i = , value = .get(i = ).inc()) + .get(i = ) + } + val a2: Int = { // BLOCK + val : C = C() + val : Int = 0 + .set(i = , value = .get(i = ).dec()) + .get(i = ) + } +} + +fun testClassOperatorPostfix() { + val a1: Int = { // BLOCK + val : C = C() + val : Int = 0 + val : Int = .get(i = ) + .set(i = , value = .inc()) + + } + val a2: Int = { // BLOCK + val : C = C() + val : Int = 0 + val : Int = .get(i = ) + .set(i = , value = .dec()) + + } +} + +fun testObjectPropPrefix() { + val p1: Int = { // BLOCK + O.( = O.().inc()) + O.() + } + val p2: Int = { // BLOCK + O.( = O.().dec()) + O.() + } +} + +fun testObjectPropPostfix() { + val p1: Int = { // BLOCK + val : Int = O.() + O.( = .inc()) + + } + val p2: Int = { // BLOCK + val : Int = O.() + O.( = .dec()) + + } +} + +fun testObjectOperatorPrefix() { + val a1: Int = { // BLOCK + val : O = O + val : Int = 0 + .set(i = , value = .get(i = ).inc()) + .get(i = ) + } + val a2: Int = { // BLOCK + val : O = O + val : Int = 0 + .set(i = , value = .get(i = ).dec()) + .get(i = ) + } +} + +fun testObjectOperatorPostfix() { + val a1: Int = { // BLOCK + val : O = O + val : Int = 0 + val : Int = .get(i = ) + .set(i = , value = .inc()) + + } + val a2: Int = { // BLOCK + val : O = O + val : Int = 0 + val : Int = .get(i = ) + .set(i = , value = .dec()) + + } +} diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt index 8e80db25182..e4cd54498e5 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.ir.txt @@ -27,6 +27,104 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:private [final,static]' type=kotlin.IntArray origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + FUN name:get visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' + GET_VAR 'i: kotlin.Int declared in .C.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.C, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + 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 [operator] 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 OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.O + CONSTRUCTOR visibility:private <> () returnType:.O [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.O + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .O' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.O, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .O declared in .O.' type=.O origin=null + value: GET_VAR ': kotlin.Int declared in .O.' type=kotlin.Int origin=null + FUN name:get visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' + GET_VAR 'i: kotlin.Int declared in .O.get' type=kotlin.Int origin=null + FUN name:set visibility:public modality:FINAL <> ($this:.O, i:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.O + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + 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 [operator] 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:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.Int [var] @@ -91,77 +189,323 @@ FILE fqName: fileName:/incrementDecrement.kt $this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null VAR name:p2 type:kotlin.Int [val] - BLOCK type=kotlin.Int origin=PREFIX_DECR - BLOCK type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PREFIX_DECR - : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR - $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR - CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PREFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=POSTFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=POSTFIX_DECR + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_3: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=PREFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_INCR - $this: GET_VAR 'val tmp_3: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_4: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=PREFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=PREFIX_DECR - $this: GET_VAR 'val tmp_5: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_6: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_5: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_6: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=PREFIX_DECR - $this: GET_VAR 'val tmp_5: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_6: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in .testArrayPrefix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_INCR - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_7: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_8: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_8: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_7: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_8: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_8: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_9: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR - $this: GET_VAR 'val tmp_9: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_9: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_10: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_10: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=POSTFIX_DECR - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.IntArray [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.IntArray [val] CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=GET_PROPERTY - VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_10: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_11: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_11: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_12: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_10: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null - index: GET_VAR 'val tmp_11: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_11: kotlin.IntArray [val] declared in .testArrayPostfix' type=kotlin.IntArray origin=null + index: GET_VAR 'val tmp_12: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR - $this: GET_VAR 'val tmp_12: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null - GET_VAR 'val tmp_12: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_13: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_13: kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + FUN name:testClassPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_14: .C [val] declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_14: .C [val] declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_14: .C [val] declared in .testClassPropPrefix' type=.C origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_15: .C [val] declared in .testClassPropPrefix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_15: .C [val] declared in .testClassPropPrefix' type=.C origin=null + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_15: .C [val] declared in .testClassPropPrefix' type=.C origin=null + FUN name:testClassPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_16: .C [val] declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_16: .C [val] declared in .testClassPropPostfix' type=.C origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_17: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_17: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_18: .C [val] declared in .testClassPropPostfix' type=.C origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_18: .C [val] declared in .testClassPropPostfix' type=.C origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_19: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_19: kotlin.Int [val] declared in .testClassPropPostfix' type=kotlin.Int origin=null + FUN name:testClassOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_20: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_21: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_20: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_21: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_20: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_21: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_22: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_23: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_22: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_23: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_22: .C [val] declared in .testClassOperatorPrefix' type=.C origin=null + i: GET_VAR 'val tmp_23: kotlin.Int [val] declared in .testClassOperatorPrefix' type=kotlin.Int origin=null + FUN name:testClassOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_24: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_25: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_24: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_25: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_26: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_26: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:.C [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_28 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_29 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .C' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_27: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_28: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .C' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_27: .C [val] declared in .testClassOperatorPostfix' type=.C origin=null + i: GET_VAR 'val tmp_28: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_29: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_29: kotlin.Int [val] declared in .testClassOperatorPostfix' type=kotlin.Int origin=null + FUN name:testObjectPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_30 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=PREFIX_INCR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_30: .O [val] declared in .testObjectPropPrefix' type=.O origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_30: .O [val] declared in .testObjectPropPrefix' type=.O origin=null + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_30: .O [val] declared in .testObjectPropPrefix' type=.O origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_31 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=PREFIX_DECR + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_31: .O [val] declared in .testObjectPropPrefix' type=.O origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_31: .O [val] declared in .testObjectPropPrefix' type=.O origin=null + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_31: .O [val] declared in .testObjectPropPrefix' type=.O origin=null + FUN name:testObjectPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_32 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_33 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_32: .O [val] declared in .testObjectPropPostfix' type=.O origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_32: .O [val] declared in .testObjectPropPostfix' type=.O origin=null + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_33: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_33: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_34 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_35 type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .O' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_34: .O [val] declared in .testObjectPropPostfix' type=.O origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .O' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_34: .O [val] declared in .testObjectPropPostfix' type=.O origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_35: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_35: kotlin.Int [val] declared in .testObjectPropPostfix' type=kotlin.Int origin=null + FUN name:testObjectOperatorPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_36 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_37 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'val tmp_36: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_37: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_36: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_37: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'val tmp_36: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_37: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=PREFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_38 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_39 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'val tmp_38: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_39: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_38: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_39: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'val tmp_38: .O [val] declared in .testObjectOperatorPrefix' type=.O origin=null + i: GET_VAR 'val tmp_39: kotlin.Int [val] declared in .testObjectOperatorPrefix' type=kotlin.Int origin=null + FUN name:testObjectOperatorPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_INCR + VAR IR_TEMPORARY_VARIABLE name:tmp_40 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_41 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_42 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_40: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_41: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_40: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_41: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'val tmp_42: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_42: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=POSTFIX_DECR + VAR IR_TEMPORARY_VARIABLE name:tmp_43 type:.O [val] + GET_OBJECT 'CLASS OBJECT name:O modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.O + VAR IR_TEMPORARY_VARIABLE name:tmp_44 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_45 type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int): kotlin.Int [operator] declared in .O' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_43: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_44: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + CALL 'public final fun set (i: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in .O' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_43: .O [val] declared in .testObjectOperatorPostfix' type=.O origin=null + i: GET_VAR 'val tmp_44: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'val tmp_45: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null + GET_VAR 'val tmp_45: kotlin.Int [val] declared in .testObjectOperatorPostfix' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.kt b/compiler/testData/ir/irText/expressions/incrementDecrement.kt index 22e719f8d61..ff28e2ac213 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.kt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.kt @@ -1,6 +1,18 @@ var p: Int = 0 val arr = intArrayOf(1, 2, 3) +class C { + var p: Int = 0 + operator fun get(i: Int) = i + operator fun set(i: Int, value: Int) {} +} + +object O { + var p: Int = 0 + operator fun get(i: Int) = i + operator fun set(i: Int, value: Int) {} +} + fun testVarPrefix() { var x = 0 val x1 = ++x @@ -20,7 +32,7 @@ fun testPropPrefix() { fun testPropPostfix() { val p1 = p++ - val p2 = --p + val p2 = p-- } fun testArrayPrefix() { @@ -31,4 +43,44 @@ fun testArrayPrefix() { fun testArrayPostfix() { val a1 = arr[0]++ val a2 = arr[0]-- -} \ No newline at end of file +} + +fun testClassPropPrefix() { + val p1 = ++C().p + val p2 = --C().p +} + +fun testClassPropPostfix() { + val p1 = C().p++ + val p2 = C().p-- +} + +fun testClassOperatorPrefix() { + val a1 = ++C()[0] + val a2 = --C()[0] +} + +fun testClassOperatorPostfix() { + val a1 = C()[0]++ + val a2 = C()[0]-- +} + +fun testObjectPropPrefix() { + val p1 = ++O.p + val p2 = --O.p +} + +fun testObjectPropPostfix() { + val p1 = O.p++ + val p2 = O.p-- +} + +fun testObjectOperatorPrefix() { + val a1 = ++O[0] + val a2 = --O[0] +} + +fun testObjectOperatorPostfix() { + val a1 = O[0]++ + val a2 = O[0]-- +} diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt index 68a297e0b80..a3744afbaea 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.kt.txt @@ -7,6 +7,48 @@ val arr: IntArray field = intArrayOf(elements = [1, 2, 3]) get +class C { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + var p: Int + field = 0 + get + set + + operator fun get(i: Int): Int { + return i + } + + operator fun set(i: Int, value: Int) { + } + +} + +object O { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + var p: Int + field = 0 + get + set + + operator fun get(i: Int): Int { + return i + } + + operator fun set(i: Int, value: Int) { + } + +} + fun testVarPrefix() { var x: Int = 0 val x1: Int = { // BLOCK @@ -58,8 +100,9 @@ fun testPropPostfix() { } val p2: Int = { // BLOCK { // BLOCK - ( = ().dec()) - () + val tmp1: Int = () + ( = tmp1.dec()) + tmp1 } } } @@ -95,3 +138,139 @@ fun testArrayPostfix() { tmp5 } } + +fun testClassPropPrefix() { + val p1: Int = { // BLOCK + val tmp0_this: C = C() + { // BLOCK + tmp0_this.( = tmp0_this.().inc()) + tmp0_this.() + } + } + val p2: Int = { // BLOCK + val tmp1_this: C = C() + { // BLOCK + tmp1_this.( = tmp1_this.().dec()) + tmp1_this.() + } + } +} + +fun testClassPropPostfix() { + val p1: Int = { // BLOCK + val tmp0_this: C = C() + { // BLOCK + val tmp1: Int = tmp0_this.() + tmp0_this.( = tmp1.inc()) + tmp1 + } + } + val p2: Int = { // BLOCK + val tmp2_this: C = C() + { // BLOCK + val tmp3: Int = tmp2_this.() + tmp2_this.( = tmp3.dec()) + tmp3 + } + } +} + +fun testClassOperatorPrefix() { + val a1: Int = { // BLOCK + val tmp0_array: C = C() + val tmp1_index0: Int = 0 + tmp0_array.set(i = tmp1_index0, value = tmp0_array.get(i = tmp1_index0).inc()) + tmp0_array.get(i = tmp1_index0) + } + val a2: Int = { // BLOCK + val tmp2_array: C = C() + val tmp3_index0: Int = 0 + tmp2_array.set(i = tmp3_index0, value = tmp2_array.get(i = tmp3_index0).dec()) + tmp2_array.get(i = tmp3_index0) + } +} + +fun testClassOperatorPostfix() { + val a1: Int = { // BLOCK + val tmp0_array: C = C() + val tmp1_index0: Int = 0 + val tmp2: Int = tmp0_array.get(i = tmp1_index0) + tmp0_array.set(i = tmp1_index0, value = tmp2.inc()) + tmp2 + } + val a2: Int = { // BLOCK + val tmp3_array: C = C() + val tmp4_index0: Int = 0 + val tmp5: Int = tmp3_array.get(i = tmp4_index0) + tmp3_array.set(i = tmp4_index0, value = tmp5.dec()) + tmp5 + } +} + +fun testObjectPropPrefix() { + val p1: Int = { // BLOCK + val tmp0_this: O = O + { // BLOCK + tmp0_this.( = tmp0_this.().inc()) + tmp0_this.() + } + } + val p2: Int = { // BLOCK + val tmp1_this: O = O + { // BLOCK + tmp1_this.( = tmp1_this.().dec()) + tmp1_this.() + } + } +} + +fun testObjectPropPostfix() { + val p1: Int = { // BLOCK + val tmp0_this: O = O + { // BLOCK + val tmp1: Int = tmp0_this.() + tmp0_this.( = tmp1.inc()) + tmp1 + } + } + val p2: Int = { // BLOCK + val tmp2_this: O = O + { // BLOCK + val tmp3: Int = tmp2_this.() + tmp2_this.( = tmp3.dec()) + tmp3 + } + } +} + +fun testObjectOperatorPrefix() { + val a1: Int = { // BLOCK + val tmp0_array: O = O + val tmp1_index0: Int = 0 + tmp0_array.set(i = tmp1_index0, value = tmp0_array.get(i = tmp1_index0).inc()) + tmp0_array.get(i = tmp1_index0) + } + val a2: Int = { // BLOCK + val tmp2_array: O = O + val tmp3_index0: Int = 0 + tmp2_array.set(i = tmp3_index0, value = tmp2_array.get(i = tmp3_index0).dec()) + tmp2_array.get(i = tmp3_index0) + } +} + +fun testObjectOperatorPostfix() { + val a1: Int = { // BLOCK + val tmp0_array: O = O + val tmp1_index0: Int = 0 + val tmp2: Int = tmp0_array.get(i = tmp1_index0) + tmp0_array.set(i = tmp1_index0, value = tmp2.inc()) + tmp2 + } + val a2: Int = { // BLOCK + val tmp3_array: O = O + val tmp4_index0: Int = 0 + val tmp5: Int = tmp3_array.get(i = tmp4_index0) + tmp3_array.set(i = tmp4_index0, value = tmp5.dec()) + tmp5 + } +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index cfc27589b29..5a82416ee7b 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -711,6 +711,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/PackageQualified.kt"); } + @Test + @TestMetadata("prefixIncReturnType.kt") + public void testPrefixIncReturnType() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncReturnType.kt"); + } + + @Test + @TestMetadata("prefixIncSmartCast.kt") + public void testPrefixIncSmartCast() throws Exception { + runTest("compiler/testData/diagnostics/tests/prefixIncSmartCast.kt"); + } + @Test @TestMetadata("PrimaryConstructors.kt") public void testPrimaryConstructors() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index a2f85fd6ca4..766f9423a07 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -25955,12 +25955,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -46903,24 +46897,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 675cdcea885..17ac6ba6c15 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -26933,12 +26933,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -49309,24 +49303,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 4f7dca1ae43..24ce62c3807 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -26933,12 +26933,6 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -49309,24 +49303,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 95f3468077d..d927930c8b6 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -21836,11 +21836,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { runTest("compiler/testData/codegen/box/intrinsics/rangeFromCollection.kt"); @@ -37989,21 +37984,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { runTest("compiler/testData/codegen/box/statics/inheritedPropertyInClassObject.kt"); diff --git a/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt b/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt index 5776b40f136..e6cb97319a6 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt @@ -40,9 +40,6 @@ object SpecialNames { @JvmField val UNARY = Name.special("") - @JvmField - val UNARY_RESULT = Name.special("") - @JvmField val THIS = Name.special("") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index 5df7edf2c5f..1f5da84a5f1 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -20857,12 +20857,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -34797,24 +34791,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index 8bcca17d5b0..c57ce03e649 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -20875,12 +20875,6 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -34983,24 +34977,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index f371a671feb..93c0a1bad45 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -20875,12 +20875,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -34983,24 +34977,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index b65cd5695b7..206f3f76ba8 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -20875,12 +20875,6 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -34983,24 +34977,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/js/js.translator/testData/box/expression/misc/KT-740-2.kt b/js/js.translator/testData/box/expression/misc/KT-740-2.kt index 675c73635a0..ded56c6248c 100644 --- a/js/js.translator/testData/box/expression/misc/KT-740-2.kt +++ b/js/js.translator/testData/box/expression/misc/KT-740-2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_K2: JS_IR // EXPECTED_REACHABLE_NODES: 1294 package foo @@ -56,4 +55,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index 31caa2df11f..47bb2632122 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -24019,12 +24019,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -39053,24 +39047,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K1NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K1NativeCodegenBoxTestGenerated.java index c2ef8fc6425..6a58a8efd25 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K1NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K1NativeCodegenBoxTestGenerated.java @@ -23797,12 +23797,6 @@ public class K1NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTes runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @Test - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @Test @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { @@ -38571,24 +38565,12 @@ public class K1NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTes runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @Test - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @Test @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @Test - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @Test @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java index f6860ad4ddb..8ce7537a3b4 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java @@ -18479,11 +18479,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/intrinsics/prefixIncDec.kt"); } - @TestMetadata("prefixIncDecFir.kt") - public void testPrefixIncDecFir() throws Exception { - runTest("compiler/testData/codegen/box/intrinsics/prefixIncDecFir.kt"); - } - @TestMetadata("rangeFromCollection.kt") public void testRangeFromCollection() throws Exception { runTest("compiler/testData/codegen/box/intrinsics/rangeFromCollection.kt"); @@ -31334,21 +31329,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/statics/incInClassObject.kt"); } - @TestMetadata("incInClassObjectFir.kt") - public void testIncInClassObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInClassObjectFir.kt"); - } - @TestMetadata("incInObject.kt") public void testIncInObject() throws Exception { runTest("compiler/testData/codegen/box/statics/incInObject.kt"); } - @TestMetadata("incInObjectFir.kt") - public void testIncInObjectFir() throws Exception { - runTest("compiler/testData/codegen/box/statics/incInObjectFir.kt"); - } - @TestMetadata("inheritedPropertyInClassObject.kt") public void testInheritedPropertyInClassObject() throws Exception { runTest("compiler/testData/codegen/box/statics/inheritedPropertyInClassObject.kt");