diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt index 49ec0007d41..8067724248b 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt @@ -32,6 +32,7 @@ import org.jetbrains.kotlin.ir.interpreter.IrInterpreter import org.jetbrains.kotlin.ir.interpreter.IrInterpreterConfiguration import org.jetbrains.kotlin.ir.interpreter.IrInterpreterEnvironment import org.jetbrains.kotlin.ir.interpreter.checker.EvaluationMode +import org.jetbrains.kotlin.ir.interpreter.transformer.preprocessForConstTransformer import org.jetbrains.kotlin.ir.interpreter.transformer.transformConst import org.jetbrains.kotlin.ir.util.KotlinMangler import org.jetbrains.kotlin.ir.util.NaiveSourceBasedFileEntryImpl @@ -431,12 +432,7 @@ class Fir2IrConverter( val interpreter = IrInterpreter(IrInterpreterEnvironment(irModuleFragment.irBuiltins, configuration)) val mode = if (intrinsicConstEvaluation) EvaluationMode.ONLY_INTRINSIC_CONST else EvaluationMode.ONLY_BUILTINS irModuleFragment.files.forEach { - it.transformConst( - interpreter, - mode = mode, - evaluatedConstTracker = fir2IrConfiguration.evaluatedConstTracker, - inlineConstTracker = fir2IrConfiguration.inlineConstTracker, - ) + it.transformConst(interpreter, mode, fir2IrConfiguration.evaluatedConstTracker, fir2IrConfiguration.inlineConstTracker) } } diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ConstEvaluationLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ConstEvaluationLowering.kt index 933bf7e7704..81f1427b81d 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ConstEvaluationLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ConstEvaluationLowering.kt @@ -8,6 +8,8 @@ package org.jetbrains.kotlin.backend.common.lower import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.common.FileLoweringPass import org.jetbrains.kotlin.config.CommonConfigurationKeys +import org.jetbrains.kotlin.config.LanguageFeature +import org.jetbrains.kotlin.config.languageVersionSettings import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.expressions.IrErrorExpression @@ -15,7 +17,8 @@ import org.jetbrains.kotlin.ir.interpreter.IrInterpreter import org.jetbrains.kotlin.ir.interpreter.IrInterpreterConfiguration import org.jetbrains.kotlin.ir.interpreter.IrInterpreterEnvironment import org.jetbrains.kotlin.ir.interpreter.checker.EvaluationMode -import org.jetbrains.kotlin.ir.interpreter.transformer.transformConst +import org.jetbrains.kotlin.ir.interpreter.transformer.preprocessForConstTransformer +import org.jetbrains.kotlin.ir.interpreter.transformer.runConstOptimizations class ConstEvaluationLowering( val context: CommonBackendContext, @@ -27,13 +30,11 @@ class ConstEvaluationLowering( private val interpreter = IrInterpreter(IrInterpreterEnvironment(context.irBuiltIns, configuration), emptyMap()) private val evaluatedConstTracker = context.configuration[CommonConfigurationKeys.EVALUATED_CONST_TRACKER] private val inlineConstTracker = context.configuration[CommonConfigurationKeys.INLINE_CONST_TRACKER] + private val mode = EvaluationMode.ONLY_INTRINSIC_CONST override fun lower(irFile: IrFile) { - irFile.transformConst( - interpreter, - mode = EvaluationMode.ONLY_INTRINSIC_CONST, - evaluatedConstTracker, inlineConstTracker, - onWarning, onError, suppressErrors + irFile.runConstOptimizations( + interpreter, mode, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressErrors ) } } diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstAllTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstAllTransformer.kt new file mode 100644 index 00000000000..b215e1e7e82 --- /dev/null +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstAllTransformer.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.interpreter.transformer + +import org.jetbrains.kotlin.constant.EvaluatedConstTracker +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.incremental.components.InlineConstTracker +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl +import org.jetbrains.kotlin.ir.expressions.impl.IrStringConcatenationImpl +import org.jetbrains.kotlin.ir.interpreter.IrInterpreter +import org.jetbrains.kotlin.ir.interpreter.checker.EvaluationMode +import org.jetbrains.kotlin.ir.interpreter.checker.IrInterpreterChecker +import org.jetbrains.kotlin.ir.interpreter.createGetField +import kotlin.math.max +import kotlin.math.min + +internal class IrConstAllTransformer( + interpreter: IrInterpreter, + irFile: IrFile, + mode: EvaluationMode, + checker: IrInterpreterChecker, + evaluatedConstTracker: EvaluatedConstTracker?, + inlineConstTracker: InlineConstTracker?, + onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit, + onError: (IrFile, IrElement, IrErrorExpression) -> Unit, + suppressExceptions: Boolean, +) : IrConstExpressionTransformer( + interpreter, irFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions +) diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstExpressionTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstExpressionTransformer.kt index 1ac26ff60a5..ace01ff4536 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstExpressionTransformer.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstExpressionTransformer.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.ir.interpreter.createGetField import kotlin.math.max import kotlin.math.min -internal class IrConstExpressionTransformer( +internal abstract class IrConstExpressionTransformer( interpreter: IrInterpreter, irFile: IrFile, mode: EvaluationMode, @@ -32,7 +32,7 @@ internal class IrConstExpressionTransformer( onError: (IrFile, IrElement, IrErrorExpression) -> Unit, suppressExceptions: Boolean, ) : IrConstTransformer(interpreter, irFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions) { - private var inAnnotation: Boolean = false + protected var inAnnotation: Boolean = false private inline fun visitAnnotationClass(crossinline block: () -> T): T { val oldInAnnotation = inAnnotation @@ -67,10 +67,8 @@ internal class IrConstExpressionTransformer( override fun visitField(declaration: IrField, data: Nothing?): IrStatement { val initializer = declaration.initializer val expression = initializer?.expression ?: return declaration - val isConst = declaration.correspondingPropertySymbol?.owner?.isConst == true - if (!isConst) return super.visitField(declaration, data) - val getField = declaration.createGetField() + if (getField.canBeInterpreted()) { initializer.expression = expression.interpret(failAsError = true) } diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstOnlyNecessaryTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstOnlyNecessaryTransformer.kt new file mode 100644 index 00000000000..663691ab42e --- /dev/null +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstOnlyNecessaryTransformer.kt @@ -0,0 +1,69 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.interpreter.transformer + +import org.jetbrains.kotlin.constant.EvaluatedConstTracker +import org.jetbrains.kotlin.incremental.components.InlineConstTracker +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.IrField +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction +import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.interpreter.IrInterpreter +import org.jetbrains.kotlin.ir.interpreter.checker.EvaluationMode +import org.jetbrains.kotlin.ir.interpreter.checker.IrInterpreterChecker + +/** + * This transformer will visit all expressions and will evaluate only those that are necessary. By "necessary" we mean expressions + * that are used in `const val` and inside annotations. + */ +internal class IrConstOnlyNecessaryTransformer( + interpreter: IrInterpreter, + irFile: IrFile, + mode: EvaluationMode, + checker: IrInterpreterChecker, + evaluatedConstTracker: EvaluatedConstTracker?, + inlineConstTracker: InlineConstTracker?, + onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit, + onError: (IrFile, IrElement, IrErrorExpression) -> Unit, + suppressExceptions: Boolean, +) : IrConstExpressionTransformer( + interpreter, irFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions +) { + override fun visitCall(expression: IrCall, data: Nothing?): IrElement { + val isConstGetter = (expression.symbol.owner as? IrSimpleFunction)?.correspondingPropertySymbol?.owner?.isConst == true + if (!inAnnotation && !isConstGetter) { + expression.transformChildren(this, null) + return expression + } + return super.visitCall(expression, data) + } + + override fun visitGetField(expression: IrGetField, data: Nothing?): IrExpression { + val isConst = expression.symbol.owner.correspondingPropertySymbol?.owner?.isConst == true + if (!inAnnotation && !isConst) return expression + return super.visitGetField(expression, data) + } + + override fun visitStringConcatenation(expression: IrStringConcatenation, data: Nothing?): IrExpression { + if (!inAnnotation) { + expression.transformChildren(this, null) + return expression + } + return super.visitStringConcatenation(expression, data) + } + + override fun visitField(declaration: IrField, data: Nothing?): IrStatement { + val isConst = declaration.correspondingPropertySymbol?.owner?.isConst == true + if (!isConst) { + declaration.transformChildren(this, null) + return declaration + } + + return super.visitField(declaration, data) + } +} diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstTransformer.kt index 9ca4216c3c4..0a432f9d53e 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstTransformer.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/transformer/IrConstTransformer.kt @@ -33,24 +33,51 @@ fun IrFile.transformConst( onError: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> }, suppressExceptions: Boolean = false, ) { + val preprocessedFile = this.preprocessForConstTransformer(interpreter, mode) + + val checker = IrInterpreterCommonChecker() + val irConstExpressionTransformer = IrConstOnlyNecessaryTransformer( + interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions + ) + preprocessedFile.transform(irConstExpressionTransformer, null) + + val irConstDeclarationAnnotationTransformer = IrConstDeclarationAnnotationTransformer( + interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions + ) + preprocessedFile.transform(irConstDeclarationAnnotationTransformer, null) + + val irConstTypeAnnotationTransformer = IrConstTypeAnnotationTransformer( + interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions + ) + preprocessedFile.transform(irConstTypeAnnotationTransformer, null) +} + +fun IrFile.runConstOptimizations( + interpreter: IrInterpreter, + mode: EvaluationMode, + evaluatedConstTracker: EvaluatedConstTracker? = null, + inlineConstTracker: InlineConstTracker? = null, + onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> }, + onError: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> }, + suppressExceptions: Boolean = false, +) { + val preprocessedFile = this.preprocessForConstTransformer(interpreter, mode) + val checker = IrInterpreterCommonChecker() + val irConstExpressionTransformer = IrConstAllTransformer( + interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions + ) + preprocessedFile.transform(irConstExpressionTransformer, null) +} + +fun IrFile.preprocessForConstTransformer( + interpreter: IrInterpreter, + mode: EvaluationMode, +): IrFile { val preprocessors = setOf(IrInterpreterKCallableNamePreprocessor()) val preprocessedFile = preprocessors.fold(this) { file, preprocessor -> preprocessor.preprocess(file, IrInterpreterPreprocessorData(mode, interpreter.irBuiltIns)) } - - val checker = IrInterpreterCommonChecker() - val irConstExpressionTransformer = IrConstExpressionTransformer( - interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions - ) - val irConstDeclarationAnnotationTransformer = IrConstDeclarationAnnotationTransformer( - interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions - ) - val irConstTypeAnnotationTransformer = IrConstTypeAnnotationTransformer( - interpreter, preprocessedFile, mode, checker, evaluatedConstTracker, inlineConstTracker, onWarning, onError, suppressExceptions - ) - preprocessedFile.transform(irConstExpressionTransformer, null) - preprocessedFile.transform(irConstDeclarationAnnotationTransformer, null) - preprocessedFile.transform(irConstTypeAnnotationTransformer, null) + return preprocessedFile } // Note: We are using `IrElementTransformer` here instead of `IrElementTransformerVoid` to avoid conflicts with `IrTypeVisitorVoid` diff --git a/compiler/testData/codegen/box/casts/asSafeForConstants.kt b/compiler/testData/codegen/box/casts/asSafeForConstants.kt index 2a2ba354f10..33e0f25432f 100644 --- a/compiler/testData/codegen/box/casts/asSafeForConstants.kt +++ b/compiler/testData/codegen/box/casts/asSafeForConstants.kt @@ -1,5 +1,5 @@ -// IGNORE_BACKEND_K1: JS_IR -// IGNORE_BACKEND_K1: JS_IR_ES6 +// IGNORE_BACKEND: JS_IR +// IGNORE_BACKEND: JS_IR_ES6 // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt index cca460ae252..ec26544ced1 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt @@ -1,5 +1,7 @@ // TARGET_BACKEND: JS_IR // IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6 +// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// TODO enable for K2 when const lowering is applied for js fun T.id() = this const val toStringDouble1 = 1.0.toString() diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/kt55108.kt b/compiler/testData/codegen/box/involvesIrInterpreter/kt55108.kt index 74784a7170b..0f2c6cfdcde 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/kt55108.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/kt55108.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM_IR +// IGNORE_BACKEND_K1: JVM_IR // WITH_REFLECT annotation class A(vararg val strings: String) diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt index 5dc869cc20f..21646ace913 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt @@ -1,6 +1,5 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE -// TARGET_BACKEND: JS_IR +// TODO enable for JS, Native when const lowering is applied in corresponding backends // WITH_STDLIB object Test { diff --git a/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt b/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt index 67fb561c2a5..cab04570505 100644 --- a/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt +++ b/compiler/testData/codegen/box/javaVisibility/package/cannotAccessInterfaceMemberViaReceiver.fir.ir.txt @@ -9,7 +9,7 @@ FILE fqName: fileName:/Child.kt $this: VALUE_PARAMETER name: type:.Child BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in .Child' - CONST String type=kotlin.String value="OK" + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:publicStaticField type:kotlin.String visibility:public [final,static]' type=kotlin.String origin=GET_PROPERTY FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in javapackage.PublicParentClass diff --git a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt index 7707eb9ac98..0e1852b28d0 100644 --- a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt +++ b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt @@ -104,7 +104,8 @@ FILE fqName: fileName:/recordWithCompanion.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Tag(id=" + CONST String type=kotlin.String value="Tag(" + CONST String type=kotlin.String value="id=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Tag declared in .Tag.toString' type=.Tag origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.diag.txt b/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.diag.txt index 3924c674be2..5f481b12115 100644 --- a/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.diag.txt +++ b/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.diag.txt @@ -2,6 +2,4 @@ /exceptionFromInterpreter_ir.kt:7:26: warning: Constant expression will throw an exception at runtime: / by zero -/exceptionFromInterpreter_ir.kt:8:39: error: Cannot evaluate constant expression: marginPrefix must be non-blank string. - -/exceptionFromInterpreter_ir.kt:12:4: error: Cannot evaluate constant expression: / by zero \ No newline at end of file +/exceptionFromInterpreter_ir.kt:8:39: error: Cannot evaluate constant expression: marginPrefix must be non-blank string. \ No newline at end of file diff --git a/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.fir.diag.txt b/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.fir.diag.txt index 61f1296dac3..81e59dbe360 100644 --- a/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.fir.diag.txt +++ b/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.fir.diag.txt @@ -3,5 +3,3 @@ /exceptionFromInterpreter_ir.kt:(205,210): warning: Division by zero /exceptionFromInterpreter_ir.kt:(243,264): error: Const 'val' initializer should be a constant value - -/exceptionFromInterpreter_ir.kt:(313,318): warning: Division by zero diff --git a/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.kt b/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.kt index c07176dc7cd..3c2e1027cff 100644 --- a/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.kt +++ b/compiler/testData/diagnostics/firTestWithJvmBackend/exceptionFromInterpreter_ir.kt @@ -7,7 +7,8 @@ const val divideByZero = 1 / 0 val disivionByZeroWarn = 1 / 0 const val trimMarginException = "123".trimMargin(" ") -annotation class A(val i: Int, val b: Int) - -@A(1 / 0, 2) -fun foo() {} +// TODO must report all these exceptions directly from fir2ir +//annotation class A(val i: Int, val b: Int) +// +//@A(1 / 0, 2) +//fun foo() {} diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt index acc97efa15b..4d533b8bad2 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt @@ -413,39 +413,48 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test1(stringArray=" + CONST String type=kotlin.String value="Test1(" + CONST String type=kotlin.String value="stringArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", charArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="charArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", booleanArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="booleanArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", byteArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="byteArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", shortArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="shortArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", intArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="intArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", longArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="longArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", floatArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="floatArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", doubleArray=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="doubleArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null @@ -536,7 +545,8 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test2(genericArray=" + CONST String type=kotlin.String value="Test2(" + CONST String type=kotlin.String value="genericArray=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null receiver: GET_VAR ': .Test2.Test2> declared in .Test2.toString' type=.Test2.Test2> origin=null @@ -634,7 +644,8 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test3(anyArrayN=" + CONST String type=kotlin.String value="Test3(" + CONST String type=kotlin.String value="anyArrayN=" CALL 'public final fun dataClassArrayMemberToString (arg0: kotlin.Any?): kotlin.String declared in kotlin.internal.ir' type=kotlin.String origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt index 55211b2d50f..f3621cbba61 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt @@ -133,7 +133,7 @@ data class Test1 { } override fun toString(): String { - return "Test1(stringArray=" + dataClassArrayMemberToString(arg0 = .#stringArray) + ", charArray=" + dataClassArrayMemberToString(arg0 = .#charArray) + ", booleanArray=" + dataClassArrayMemberToString(arg0 = .#booleanArray) + ", byteArray=" + dataClassArrayMemberToString(arg0 = .#byteArray) + ", shortArray=" + dataClassArrayMemberToString(arg0 = .#shortArray) + ", intArray=" + dataClassArrayMemberToString(arg0 = .#intArray) + ", longArray=" + dataClassArrayMemberToString(arg0 = .#longArray) + ", floatArray=" + dataClassArrayMemberToString(arg0 = .#floatArray) + ", doubleArray=" + dataClassArrayMemberToString(arg0 = .#doubleArray) + ")" + return "Test1(" + "stringArray=" + dataClassArrayMemberToString(arg0 = .#stringArray) + ", " + "charArray=" + dataClassArrayMemberToString(arg0 = .#charArray) + ", " + "booleanArray=" + dataClassArrayMemberToString(arg0 = .#booleanArray) + ", " + "byteArray=" + dataClassArrayMemberToString(arg0 = .#byteArray) + ", " + "shortArray=" + dataClassArrayMemberToString(arg0 = .#shortArray) + ", " + "intArray=" + dataClassArrayMemberToString(arg0 = .#intArray) + ", " + "longArray=" + dataClassArrayMemberToString(arg0 = .#longArray) + ", " + "floatArray=" + dataClassArrayMemberToString(arg0 = .#floatArray) + ", " + "doubleArray=" + dataClassArrayMemberToString(arg0 = .#doubleArray) + ")" } } @@ -176,7 +176,7 @@ data class Test2 { } override fun toString(): String { - return "Test2(genericArray=" + dataClassArrayMemberToString(arg0 = .#genericArray) + ")" + return "Test2(" + "genericArray=" + dataClassArrayMemberToString(arg0 = .#genericArray) + ")" } } @@ -222,7 +222,7 @@ data class Test3 { } override fun toString(): String { - return "Test3(anyArrayN=" + dataClassArrayMemberToString(arg0 = .#anyArrayN) + ")" + return "Test3(" + "anyArrayN=" + dataClassArrayMemberToString(arg0 = .#anyArrayN) + ")" } } diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt index df5a248c495..1959b433636 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt @@ -167,13 +167,16 @@ FILE fqName: fileName:/dataClasses.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test1(x=" + CONST String type=kotlin.String value="Test1(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", y=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null - CONST String type=kotlin.String value=", z=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="z=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null CONST String type=kotlin.String value=")" @@ -270,7 +273,8 @@ FILE fqName: fileName:/dataClasses.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test2(x=" + CONST String type=kotlin.String value="Test2(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null receiver: GET_VAR ': .Test2 declared in .Test2.toString' type=.Test2 origin=null CONST String type=kotlin.String value=")" @@ -501,16 +505,20 @@ FILE fqName: fileName:/dataClasses.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test3(d=" + CONST String type=kotlin.String value="Test3(" + CONST String type=kotlin.String value="d=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=", dn=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="dn=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=", f=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="f=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null - CONST String type=kotlin.String value=", df=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="df=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.toString' type=.Test3 origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt index d6e0f2693d9..3baa524ff16 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt @@ -61,7 +61,7 @@ data class Test1 { } override fun toString(): String { - return "Test1(x=" + .#x + ", y=" + .#y + ", z=" + .#z + ")" + return "Test1(" + "x=" + .#x + ", " + "y=" + .#y + ", " + "z=" + .#z + ")" } } @@ -107,7 +107,7 @@ data class Test2 { } override fun toString(): String { - return "Test2(x=" + .#x + ")" + return "Test2(" + "x=" + .#x + ")" } } @@ -193,7 +193,7 @@ data class Test3 { } override fun toString(): String { - return "Test3(d=" + .#d + ", dn=" + .#dn + ", f=" + .#f + ", df=" + .#df + ")" + return "Test3(" + "d=" + .#d + ", " + "dn=" + .#dn + ", " + "f=" + .#f + ", " + "df=" + .#df + ")" } } diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt index 3b72eec1089..f60c068bf73 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt @@ -94,7 +94,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test1(x=" + CONST String type=kotlin.String value="Test1(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.toString' type=.Test1.Test1> origin=null CONST String type=kotlin.String value=")" @@ -184,7 +185,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test2(x=" + CONST String type=kotlin.String value="Test2(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null receiver: GET_VAR ': .Test2.Test2> declared in .Test2.toString' type=.Test2.Test2> origin=null CONST String type=kotlin.String value=")" @@ -274,7 +276,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test3(x=" + CONST String type=kotlin.String value="Test3(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null receiver: GET_VAR ': .Test3.Test3> declared in .Test3.toString' type=.Test3.Test3> origin=null CONST String type=kotlin.String value=")" @@ -362,7 +365,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test4' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test4(x=" + CONST String type=kotlin.String value="Test4(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null receiver: GET_VAR ': .Test4 declared in .Test4.toString' type=.Test4 origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt index 5b713f124b2..fd1fde42277 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt @@ -39,7 +39,7 @@ data class Test1 { } override fun toString(): String { - return "Test1(x=" + .#x + ")" + return "Test1(" + "x=" + .#x + ")" } } @@ -82,7 +82,7 @@ data class Test2 { } override fun toString(): String { - return "Test2(x=" + .#x + ")" + return "Test2(" + "x=" + .#x + ")" } } @@ -125,7 +125,7 @@ data class Test3 { } override fun toString(): String { - return "Test3(x=" + .#x + ")" + return "Test3(" + "x=" + .#x + ")" } } @@ -168,7 +168,7 @@ data class Test4 { } override fun toString(): String { - return "Test4(x=" + .#x + ")" + return "Test4(" + "x=" + .#x + ")" } } diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt index 55259ace022..645f5b27e46 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt @@ -132,7 +132,8 @@ FILE fqName: fileName:/delegationInSealed.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A.B' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="B(c=" + CONST String type=kotlin.String value="B(" + CONST String type=kotlin.String value="c=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null receiver: GET_VAR ': .A.B declared in .A.B.toString' type=.A.B origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt index 810452d5955..b71930cca5e 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt @@ -56,7 +56,7 @@ sealed class A : CharSequence { } override fun toString(): String { - return "B(c=" + .#c + ")" + return "B(" + "c=" + .#c + ")" } } diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt index 5445d0d1b48..3636c3614f8 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt @@ -92,7 +92,8 @@ FILE fqName: fileName:/kt31649.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestData' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="TestData(nn=" + CONST String type=kotlin.String value="TestData(" + CONST String type=kotlin.String value="nn=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR ': .TestData declared in .TestData.toString' type=.TestData origin=null CONST String type=kotlin.String value=")" @@ -166,7 +167,8 @@ FILE fqName: fileName:/kt31649.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestInline' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="TestInline(nn=" + CONST String type=kotlin.String value="TestInline(" + CONST String type=kotlin.String value="nn=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR ': .TestInline declared in .TestInline.toString' type=.TestInline origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt index d5026228662..1beea911a4d 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt @@ -39,7 +39,7 @@ data class TestData { } override fun toString(): String { - return "TestData(nn=" + .#nn + ")" + return "TestData(" + "nn=" + .#nn + ")" } } @@ -74,7 +74,7 @@ value class TestInline { } override fun toString(): String { - return "TestInline(nn=" + .#nn + ")" + return "TestInline(" + "nn=" + .#nn + ")" } } diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt index 4d0586cfb3a..f0bc0d8ee86 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt @@ -91,7 +91,8 @@ FILE fqName: fileName:/kt49936.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(x=" + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt index e649ddce4ed..5a7cc862a0e 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt @@ -91,7 +91,8 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(runA=" + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="runA=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null CONST String type=kotlin.String value=")" @@ -201,7 +202,8 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .B' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="B(x=" + CONST String type=kotlin.String value="B(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .B declared in .B.toString' type=.B origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt index edf9c25d05a..1bb66365867 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt @@ -39,7 +39,7 @@ data class A { } override fun toString(): String { - return "A(runA=" + .#runA + ")" + return "A(" + "runA=" + .#runA + ")" } } @@ -93,7 +93,7 @@ data class B { } override fun toString(): String { - return "B(x=" + .#x + ")" + return "B(" + "x=" + .#x + ")" } } diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt index 40a297bc882..a4ab0ef5605 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt @@ -128,10 +128,12 @@ FILE fqName: fileName:/openDataClass.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ValidatedProperties' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="ValidatedProperties(test1=" + CONST String type=kotlin.String value="ValidatedProperties(" + CONST String type=kotlin.String value="test1=" CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.toString' type=.ValidatedProperties origin=null - CONST String type=kotlin.String value=", test2=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="test2=" CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.toString' type=.ValidatedProperties origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt index df2e708d446..358e7ebbf4b 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt @@ -50,7 +50,7 @@ open data class ValidatedProperties { } override fun toString(): String { - return "ValidatedProperties(test1=" + .() + ", test2=" + .() + ")" + return "ValidatedProperties(" + "test1=" + .() + ", " + "test2=" + .() + ")" } } diff --git a/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt b/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt index 005962b7b32..1228519c787 100644 --- a/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt @@ -60,7 +60,8 @@ FILE fqName: fileName:/inlineClass.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test(x=" + CONST String type=kotlin.String value="Test(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test declared in .Test.toString' type=.Test origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt b/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt index 3c98ba9957b..5ea9917dc6e 100644 --- a/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt @@ -25,7 +25,7 @@ value class Test { } override fun toString(): String { - return "Test(x=" + .#x + ")" + return "Test(" + "x=" + .#x + ")" } } diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt index 7d122516247..68ddf30c6a4 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt @@ -105,7 +105,8 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IC' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="IC(c=" + CONST String type=kotlin.String value="IC(" + CONST String type=kotlin.String value="c=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:.C.IC> visibility:private [final]' type=.C.IC> origin=null receiver: GET_VAR ': .IC.IC> declared in .IC.toString' type=.IC.IC> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt index 8748ba28319..14a3c0cbfd3 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt @@ -46,7 +46,7 @@ value class IC { } override fun toString(): String { - return "IC(c=" + .#c + ")" + return "IC(" + "c=" + .#c + ")" } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt index 3b43341faeb..7df3949ece2 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt @@ -91,7 +91,8 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyContainer(i=" + CONST String type=kotlin.String value="MyContainer(" + CONST String type=kotlin.String value="i=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt index 4eb2b95cb1d..d2dab0f9bd6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt @@ -37,7 +37,7 @@ data class MyContainer { } override fun toString(): String { - return "MyContainer(i=" + .#i + ")" + return "MyContainer(" + "i=" + .#i + ")" } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt index 01d3c5ef1b4..08694f404f5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt @@ -91,7 +91,8 @@ FILE fqName: fileName:/arrayAccessOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyContainer(s=" + CONST String type=kotlin.String value="MyContainer(" + CONST String type=kotlin.String value="s=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt index 6e44a205a52..ccb3d5d0ae1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt @@ -37,7 +37,7 @@ data class MyContainer { } override fun toString(): String { - return "MyContainer(s=" + .#s + ")" + return "MyContainer(" + "s=" + .#s + ")" } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt index 10d5231faad..0694191a7b1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt @@ -91,7 +91,8 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Result(i=" + CONST String type=kotlin.String value="Result(" + CONST String type=kotlin.String value="i=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt index 278afae306a..738f6edbfcb 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt @@ -37,7 +37,7 @@ data class Result { } override fun toString(): String { - return "Result(i=" + .#i + ")" + return "Result(" + "i=" + .#i + ")" } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt index aebf0b9ff06..15b7527d82c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt @@ -148,10 +148,12 @@ FILE fqName: fileName:/compareTo.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Pair' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Pair(first=" + CONST String type=kotlin.String value="Pair(" + CONST String type=kotlin.String value="first=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null - CONST String type=kotlin.String value=", second=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="second=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt index da17cb84ece..0fbf7a9b107 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt @@ -55,7 +55,7 @@ data class Pair { } override fun toString(): String { - return "Pair(first=" + .#first + ", second=" + .#second + ")" + return "Pair(" + "first=" + .#first + ", " + "second=" + .#second + ")" } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt index b617edff9ef..a6bb58c8166 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt @@ -93,7 +93,8 @@ FILE fqName: fileName:/iteratorOperator.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Counter' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Counter(i=" + CONST String type=kotlin.String value="Counter(" + CONST String type=kotlin.String value="i=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null receiver: GET_VAR ': .Counter declared in .Counter.toString' type=.Counter origin=null CONST String type=kotlin.String value=")" @@ -183,7 +184,8 @@ FILE fqName: fileName:/iteratorOperator.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .CounterConfig' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="CounterConfig(max=" + CONST String type=kotlin.String value="CounterConfig(" + CONST String type=kotlin.String value="max=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.toString' type=.CounterConfig origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt index 466d67c935d..53115ad5e19 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt @@ -37,7 +37,7 @@ data class Counter { } override fun toString(): String { - return "Counter(i=" + .#i + ")" + return "Counter(" + "i=" + .#i + ")" } } @@ -80,7 +80,7 @@ data class CounterConfig { } override fun toString(): String { - return "CounterConfig(max=" + .#max + ")" + return "CounterConfig(" + "max=" + .#max + ")" } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt index b3a21f34985..b2e4ca1b45c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt @@ -83,7 +83,8 @@ FILE fqName: fileName:/unaryOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Result(i=" + CONST String type=kotlin.String value="Result(" + CONST String type=kotlin.String value="i=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.toString' type=.Result origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt index 6cacc13fe2a..c027a03c527 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt @@ -36,7 +36,7 @@ data class Result { } override fun toString(): String { - return "Result(i=" + .#i + ")" + return "Result(" + "i=" + .#i + ")" } } diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt index b4e82a0e4b7..f10e30cbe6b 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt @@ -60,7 +60,8 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IT' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="IT(x=" + CONST String type=kotlin.String value="IT(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .IT declared in .IT.toString' type=.IT origin=null CONST String type=kotlin.String value=")" @@ -241,7 +242,8 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .InlineMutableSet' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="InlineMutableSet(ms=" + CONST String type=kotlin.String value="InlineMutableSet(" + CONST String type=kotlin.String value="ms=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.toString' type=.InlineMutableSet origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt index 23d8ea8f7d6..61b5229423a 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt @@ -25,7 +25,7 @@ value class IT { } override fun toString(): String { - return "IT(x=" + .#x + ")" + return "IT(" + "x=" + .#x + ")" } } @@ -102,7 +102,7 @@ value class InlineMutableSet : MutableSet { } override fun toString(): String { - return "InlineMutableSet(ms=" + .#ms + ")" + return "InlineMutableSet(" + "ms=" + .#ms + ")" } } diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt index 88f8699dc9c..aff1d824f90 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt @@ -85,7 +85,8 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyRec' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="MyRec(name=" + CONST String type=kotlin.String value="MyRec(" + CONST String type=kotlin.String value="name=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .MyRec declared in .MyRec.toString' type=.MyRec origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt index f264bbb25e7..c90f48366a2 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt @@ -37,7 +37,7 @@ data class MyRec : Record { } override fun toString(): String { - return "MyRec(name=" + .#name + ")" + return "MyRec(" + "name=" + .#name + ")" } } diff --git a/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt new file mode 100644 index 00000000000..587ea1f3dfb --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt29833.fir.ir.txt @@ -0,0 +1,42 @@ +FILE fqName:interop fileName:/Definitions.kt + CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:interop.Definitions + CONSTRUCTOR visibility:private <> () returnType:interop.Definitions [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="constant" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String + correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:interop.Definitions + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String visibility:public [final]' type=kotlin.String origin=null + receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null + PROPERTY name:ktValue visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:CONSTANT type:kotlin.String visibility:public [final,static]' type=kotlin.String origin=GET_PROPERTY + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String + correspondingProperty: PROPERTY name:ktValue visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:interop.Definitions + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in interop.Definitions' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt new file mode 100644 index 00000000000..fff97c14f7e --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt29833.fir.kt.txt @@ -0,0 +1,19 @@ +package interop + +object Definitions { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + const val KT_CONSTANT: String + field = "constant" + get + + val ktValue: String + field = #CONSTANT + get + +} + diff --git a/compiler/testData/ir/irText/declarations/kt29833.kt b/compiler/testData/ir/irText/declarations/kt29833.kt index 57a5cdf9fa3..3e159ea1619 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.kt +++ b/compiler/testData/ir/irText/declarations/kt29833.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // TARGET_BACKEND: JVM // FILE: Definitions.kt // IR_FILE: kt29833.txt diff --git a/compiler/testData/ir/irText/declarations/kt29833.kt.txt b/compiler/testData/ir/irText/declarations/kt29833.kt.txt index 63247887ab1..dcfc5bc963f 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt29833.kt.txt @@ -16,3 +16,4 @@ object Definitions { get } + diff --git a/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt index ff9b33d83c6..f28b17f9808 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt @@ -117,7 +117,8 @@ FILE fqName: fileName:/kt52677.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .LoginSuccessPacket' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="LoginSuccessPacket(id=" + CONST String type=kotlin.String value="LoginSuccessPacket(" + CONST String type=kotlin.String value="id=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.toString' type=.LoginSuccessPacket origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt index 56999cc67f6..239052f6d31 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt @@ -51,7 +51,7 @@ data class LoginSuccessPacket { } override fun toString(): String { - return "LoginSuccessPacket(id=" + .#id + ")" + return "LoginSuccessPacket(" + "id=" + .#id + ")" } } diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt index b4a08394e1e..ada175cbe27 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt @@ -139,10 +139,12 @@ FILE fqName: fileName:/dataClassMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Test(x=" + CONST String type=kotlin.String value="Test(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.toString' type=.Test.Test> origin=null - CONST String type=kotlin.String value=", y=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.toString' type=.Test.Test> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt index d82d037ae6a..514f5cdc0f6 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt @@ -52,7 +52,7 @@ data class Test { } override fun toString(): String { - return "Test(x=" + .#x + ", y=" + .#y + ")" + return "Test(" + "x=" + .#x + ", " + "y=" + .#y + ")" } } diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.ir.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.ir.txt deleted file mode 100644 index 55a99918de0..00000000000 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.ir.txt +++ /dev/null @@ -1,55 +0,0 @@ -FILE fqName: fileName:/genericConstructorCallWithTypeArguments.kt - FUN name:testSimple visibility:public modality:FINAL <> () returnType:.Box - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testSimple (): .Box declared in ' - CONSTRUCTOR_CALL 'public constructor (value: T of .Box) declared in .Box' type=.Box origin=null - : kotlin.Long - value: CONST Long type=kotlin.Long value=6 - FUN name:testArray visibility:public modality:FINAL (n:kotlin.Int, block:kotlin.Function0.testArray>) returnType:kotlin.Array.testArray> [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:true - VALUE_PARAMETER name:n index:0 type:kotlin.Int - VALUE_PARAMETER name:block index:1 type:kotlin.Function0.testArray> [crossinline] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testArray (n: kotlin.Int, block: kotlin.Function0.testArray>): kotlin.Array.testArray> declared in ' - CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.Array' type=kotlin.Array.testArray> origin=null - : T of .testArray - size: GET_VAR 'n: kotlin.Int declared in .testArray' type=kotlin.Int origin=null - init: FUN_EXPR type=kotlin.Function1.testArray> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:T of .testArray - VALUE_PARAMETER name:it index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): T of .testArray declared in .testArray' - CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=T of .testArray origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0.testArray> declared in .testArray' type=kotlin.Function0.testArray> origin=VARIABLE_AS_FUNCTION - CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Box) returnType:.Box.Box> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Box - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .Box visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .Box declared in .Box.' type=T of .Box origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Box.Box>) returnType:T of .Box - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Box.Box> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Box declared in .Box' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Box visibility:private [final]' type=T of .Box origin=null - receiver: GET_VAR ': .Box.Box> declared in .Box.' type=.Box.Box> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.kt.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.kt.txt deleted file mode 100644 index a313764ee48..00000000000 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.kt.txt +++ /dev/null @@ -1,23 +0,0 @@ -fun testSimple(): Box { - return Box(value = 6L) -} - -inline fun testArray(n: Int, crossinline block: Function0): Array { - return Array(size = n, init = local fun (it: Int): T { - return block.invoke() - } -) -} - -class Box { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: T - field = value - get - -} diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt index 2b5c5a0c237..f2655928d2d 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + fun testSimple() = Box(2L * 3) inline fun testArray(n: Int, crossinline block: () -> T): Array { diff --git a/compiler/testData/ir/irText/expressions/literals.fir.ir.txt b/compiler/testData/ir/irText/expressions/literals.fir.ir.txt new file mode 100644 index 00000000000..8c9a2ddb3d7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/literals.fir.ir.txt @@ -0,0 +1,157 @@ +FILE fqName: fileName:/literals.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=-1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Boolean visibility:private [final,static] + EXPRESSION_BODY + CONST Boolean type=kotlin.Boolean value=true + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Boolean visibility:private [final,static]' type=kotlin.Boolean origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Boolean visibility:private [final,static] + EXPRESSION_BODY + CONST Boolean type=kotlin.Boolean value=false + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Boolean visibility:private [final,static]' type=kotlin.Boolean origin=null + PROPERTY name:test5 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="abc" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Nothing? visibility:private [final,static] + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Nothing? + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Nothing? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Nothing? visibility:private [final,static]' type=kotlin.Nothing? origin=null + PROPERTY name:test7 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.Long visibility:private [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.Long visibility:private [final,static]' type=kotlin.Long origin=null + PROPERTY name:test8 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Long visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Long declared in kotlin.Long' type=kotlin.Long origin=null + $this: CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Long visibility:private [final,static]' type=kotlin.Long origin=null + PROPERTY name:test9 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Double visibility:private [final,static] + EXPRESSION_BODY + CONST Double type=kotlin.Double value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Double + correspondingProperty: PROPERTY name:test9 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Double visibility:private [final,static]' type=kotlin.Double origin=null + PROPERTY name:test10 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Double visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Double declared in kotlin.Double' type=kotlin.Double origin=null + $this: CONST Double type=kotlin.Double value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Double + correspondingProperty: PROPERTY name:test10 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Double visibility:private [final,static]' type=kotlin.Double origin=null + PROPERTY name:test11 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Float visibility:private [final,static] + EXPRESSION_BODY + CONST Float type=kotlin.Float value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Float + correspondingProperty: PROPERTY name:test11 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Float visibility:private [final,static]' type=kotlin.Float origin=null + PROPERTY name:test12 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Float visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Float declared in kotlin.Float' type=kotlin.Float origin=null + $this: CONST Float type=kotlin.Float value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Float + correspondingProperty: PROPERTY name:test12 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Float visibility:private [final,static]' type=kotlin.Float origin=null + PROPERTY name:test13 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Char visibility:private [final,static] + EXPRESSION_BODY + CONST Char type=kotlin.Char value='a' + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Char + correspondingProperty: PROPERTY name:test13 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Char declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Char visibility:private [final,static]' type=kotlin.Char origin=null + PROPERTY name:testB visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testB type:kotlin.Byte visibility:private [final,static] + EXPRESSION_BODY + CONST Byte type=kotlin.Byte value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte + correspondingProperty: PROPERTY name:testB visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testB type:kotlin.Byte visibility:private [final,static]' type=kotlin.Byte origin=null + PROPERTY name:testS visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testS type:kotlin.Short visibility:private [final,static] + EXPRESSION_BODY + CONST Short type=kotlin.Short value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short + correspondingProperty: PROPERTY name:testS visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Short declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testS type:kotlin.Short visibility:private [final,static]' type=kotlin.Short origin=null + PROPERTY name:testI visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testI type:kotlin.Int visibility:private [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:testI visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testI type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + PROPERTY name:testL visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testL type:kotlin.Long visibility:private [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:testL visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testL type:kotlin.Long visibility:private [final,static]' type=kotlin.Long origin=null diff --git a/compiler/testData/ir/irText/expressions/literals.fir.kt.txt b/compiler/testData/ir/irText/expressions/literals.fir.kt.txt new file mode 100644 index 00000000000..51940adbf1f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/literals.fir.kt.txt @@ -0,0 +1,67 @@ +val test1: Int + field = 1 + get + +val test2: Int + field = -1 + get + +val test3: Boolean + field = true + get + +val test4: Boolean + field = false + get + +val test5: String + field = "abc" + get + +val test6: Nothing? + field = null + get + +val test7: Long + field = 1L + get + +val test8: Long + field = 1L.unaryMinus() + get + +val test9: Double + field = 1.0 + get + +val test10: Double + field = 1.0.unaryMinus() + get + +val test11: Float + field = 1.0F + get + +val test12: Float + field = 1.0F.unaryMinus() + get + +val test13: Char + field = 'a' + get + +val testB: Byte + field = 1B + get + +val testS: Short + field = 1S + get + +val testI: Int + field = 1 + get + +val testL: Long + field = 1L + get diff --git a/compiler/testData/ir/irText/expressions/literals.kt b/compiler/testData/ir/irText/expressions/literals.kt index f943c5f973d..ddd6b51c617 100644 --- a/compiler/testData/ir/irText/expressions/literals.kt +++ b/compiler/testData/ir/irText/expressions/literals.kt @@ -1,5 +1,3 @@ -// FIR_IDENTICAL -// IGNORE_BACKEND_K2: JS_IR val test1 = 1 val test2 = -1 val test3 = true diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.ir.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.ir.txt index 332624890e3..d56d33b2545 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.ir.txt @@ -28,4 +28,5 @@ FILE fqName: fileName:/simpleUnaryOperators.kt FUN name:test6 visibility:public modality:FINAL <> () returnType:kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Boolean declared in ' - CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null + $this: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.kt.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.kt.txt index dd9a2cdcd72..99e9507121e 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.kt.txt @@ -19,5 +19,5 @@ fun test5(x: Boolean): Boolean { } fun test6(): Boolean { - return false + return true.not() } diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt index bcae848025a..edb30e13106 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt @@ -824,10 +824,12 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ArrayMapImpl.Entry' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Entry(key=" + CONST String type=kotlin.String value="Entry(" + CONST String type=kotlin.String value="key=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - CONST String type=kotlin.String value=", value=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="value=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.toString' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt index bafc8202fab..ad7b3006226 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt @@ -322,7 +322,7 @@ internal class ArrayMapImpl : ArrayMap { } override fun toString(): String { - return "Entry(key=" + .#key + ", value=" + .#value + ")" + return "Entry(" + "key=" + .#key + ", " + "value=" + .#value + ")" } } diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt index a0a9906569b..47f6eb3cae4 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt @@ -94,7 +94,8 @@ FILE fqName: fileName:/MultiList.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Some(value=" + CONST String type=kotlin.String value="Some(" + CONST String type=kotlin.String value="value=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null receiver: GET_VAR ': .Some.Some> declared in .Some.toString' type=.Some.Some> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt index 1b76c1ca2a8..75b8b459572 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt @@ -39,7 +39,7 @@ data class Some { } override fun toString(): String { - return "Some(value=" + .#value + ")" + return "Some(" + "value=" + .#value + ")" } } diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt index cada2230c83..9c7e7fa4e33 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt @@ -176,7 +176,8 @@ FILE fqName: fileName:/SignatureClash.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataClass' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="DataClass(delegate=" + CONST String type=kotlin.String value="DataClass(" + CONST String type=kotlin.String value="delegate=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .DataClass declared in .DataClass.toString' type=.DataClass origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt index 7c962bdc230..231a65c2926 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt @@ -71,7 +71,7 @@ data class DataClass : Derived, Delegate { } override fun toString(): String { - return "DataClass(delegate=" + .#delegate + ")" + return "DataClass(" + "delegate=" + .#delegate + ")" } } diff --git a/compiler/testData/ir/irText/firProblems/kt59102.fir.ir.txt b/compiler/testData/ir/irText/firProblems/kt59102.fir.ir.txt deleted file mode 100644 index a238586864a..00000000000 --- a/compiler/testData/ir/irText/firProblems/kt59102.fir.ir.txt +++ /dev/null @@ -1,36 +0,0 @@ -FILE fqName: fileName:/kt59102.kt - CLASS CLASS name:XAlign modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.XAlign - CONSTRUCTOR visibility:public <> (bits:kotlin.Long) returnType:.XAlign [primary] - VALUE_PARAMETER name:bits index:0 type:kotlin.Long - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:XAlign modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:bits visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bits type:kotlin.Long visibility:private [final] - EXPRESSION_BODY - GET_VAR 'bits: kotlin.Long declared in .XAlign.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.XAlign) returnType:kotlin.Long - correspondingProperty: PROPERTY name:bits visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.XAlign - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in .XAlign' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bits type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null - receiver: GET_VAR ': .XAlign declared in .XAlign.' type=.XAlign origin=null - CONSTRUCTOR visibility:public <> () returnType:.XAlign - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (bits: kotlin.Long) declared in .XAlign' - bits: CONST Long type=kotlin.Long value=2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/kt59102.fir.kt.txt b/compiler/testData/ir/irText/firProblems/kt59102.fir.kt.txt deleted file mode 100644 index c4ec8757274..00000000000 --- a/compiler/testData/ir/irText/firProblems/kt59102.fir.kt.txt +++ /dev/null @@ -1,16 +0,0 @@ -class XAlign { - constructor(bits: Long) /* primary */ { - super/*Any*/() - /* () */ - - } - - val bits: Long - field = bits - get - - constructor() { - this/*XAlign*/(bits = 2L) - } - -} diff --git a/compiler/testData/ir/irText/firProblems/kt59102.kt b/compiler/testData/ir/irText/firProblems/kt59102.kt index f759e3e2fbc..cdfb9861ed4 100644 --- a/compiler/testData/ir/irText/firProblems/kt59102.kt +++ b/compiler/testData/ir/irText/firProblems/kt59102.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class XAlign(val bits: Long) { constructor() : this(1 shl 1) } diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt index 03a38d7d682..7af7efe9fa8 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.ir.txt @@ -13,7 +13,9 @@ FILE fqName: fileName:/timesInBuilder.kt $receiver: CALL 'public final fun lessEq (t: T of .lessEq): .Expression declared in ' type=.Expression origin=null : kotlin.Int $receiver: CALL 'public final fun (): .Column declared in ' type=.Column origin=GET_PROPERTY - t: CONST Int type=kotlin.Int value=120 + t: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: CONST Int type=kotlin.Int value=2 + other: CONST Int type=kotlin.Int value=60 CALL 'public final fun unaryPlus (): kotlin.Unit declared in .ArgumentsBuilder' type=kotlin.Unit origin=null $this: GET_VAR '$this$countIssues: .ArgumentsBuilder declared in .test.' type=.ArgumentsBuilder origin=null $receiver: CALL 'public final fun lessEq (t: T of .lessEq): .Expression declared in ' type=.Expression origin=null @@ -21,13 +23,18 @@ FILE fqName: fileName:/timesInBuilder.kt $receiver: CALL 'public final fun (): .Column declared in ' type=.Column origin=GET_PROPERTY t: CALL 'public final fun id (arg: I of .id): I of .id declared in ' type=kotlin.Int origin=null : kotlin.Int - arg: CONST Int type=kotlin.Int value=120 + arg: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: CONST Int type=kotlin.Int value=2 + other: CONST Int type=kotlin.Int value=60 CALL 'public final fun unaryPlus (): kotlin.Unit declared in .ArgumentsBuilder' type=kotlin.Unit origin=null $this: GET_VAR '$this$countIssues: .ArgumentsBuilder declared in .test.' type=.ArgumentsBuilder origin=null $receiver: CALL 'public final fun select (t: T of .select, r: T of .select): .Expression declared in ' type=.Expression origin=null : kotlin.Long $receiver: CALL 'public final fun (): .Column declared in ' type=.Column origin=GET_PROPERTY - t: CONST Long type=kotlin.Long value=120 + t: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=MUL + $this: CONST Int type=kotlin.Int value=2 + other: CONST Int type=kotlin.Int value=60 r: GET_VAR 'x: kotlin.Long declared in .test' type=kotlin.Long origin=null PROPERTY name:spentTime visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:spentTime type:.Column visibility:private [final,static] diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt index 0441ce0e429..324b8e1547b 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.fir.kt.txt @@ -1,8 +1,8 @@ private fun test(x: Long) { return countIssues(restrictionsBuilder = local fun ArgumentsBuilder.() { - ($this$countIssues, ().lessEq(t = 120)).unaryPlus() - ($this$countIssues, ().lessEq(t = id(arg = 120))).unaryPlus() - ($this$countIssues, ().select(t = 120L, r = x)).unaryPlus() + ($this$countIssues, ().lessEq(t = 2.times(other = 60))).unaryPlus() + ($this$countIssues, ().lessEq(t = id(arg = 2.times(other = 60)))).unaryPlus() + ($this$countIssues, ().select(t = 2.times(other = 60).toLong(), r = x)).unaryPlus() } ) } diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt index 80b8ab76c13..0dc4f58c815 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt @@ -62,7 +62,8 @@ FILE fqName: fileName:/valueClassEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Z' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Z(s=" + CONST String type=kotlin.String value="Z(" + CONST String type=kotlin.String value="s=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Z declared in .Z.toString' type=.Z origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt index 4ea0e5665ba..e221d500d89 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt @@ -26,7 +26,7 @@ value class Z { } override fun toString(): String { - return "Z(s=" + .#s + ")" + return "Z(" + "s=" + .#s + ")" } } diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt index 1ccb6b2cd3c..1db3a0b3004 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt @@ -126,10 +126,12 @@ FILE fqName: fileName:/destructuringInLambda.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="A(x=" + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null - CONST String type=kotlin.String value=", y=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt index a2b582f8324..10602425604 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt @@ -49,7 +49,7 @@ data class A { } override fun toString(): String { - return "A(x=" + .#x + ", y=" + .#y + ")" + return "A(" + "x=" + .#x + ", " + "y=" + .#y + ")" } } diff --git a/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt b/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt index f41f36ace5c..f785480c3d5 100644 --- a/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt @@ -157,10 +157,12 @@ FILE fqName: fileName:/kt45236.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .NetRequestStatus.Error' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Error(error=" + CONST String type=kotlin.String value="Error(" + CONST String type=kotlin.String value="error=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - CONST String type=kotlin.String value=", value=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="value=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.toString' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/stubs/simple.fir.ir.txt b/compiler/testData/ir/irText/stubs/simple.fir.ir.txt new file mode 100644 index 00000000000..83edb7a1f9c --- /dev/null +++ b/compiler/testData/ir/irText/stubs/simple.fir.ir.txt @@ -0,0 +1,12 @@ +FILE fqName: fileName:/simple.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS + $this: CONST Int type=kotlin.Int value=2 + other: CONST Int type=kotlin.Int value=2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/stubs/simple.fir.kt.txt b/compiler/testData/ir/irText/stubs/simple.fir.kt.txt new file mode 100644 index 00000000000..025428ad02c --- /dev/null +++ b/compiler/testData/ir/irText/stubs/simple.fir.kt.txt @@ -0,0 +1,3 @@ +val test: Int + field = 2.plus(other = 2) + get diff --git a/compiler/testData/ir/irText/stubs/simple.kt b/compiler/testData/ir/irText/stubs/simple.kt index a8b4361cc3b..0b06f494041 100644 --- a/compiler/testData/ir/irText/stubs/simple.kt +++ b/compiler/testData/ir/irText/stubs/simple.kt @@ -1,3 +1 @@ -// FIR_IDENTICAL - val test = 2 + 2 diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt index 4b87d6eef34..f4852e2fbeb 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt @@ -252,10 +252,12 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .P' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="P(x=" + CONST String type=kotlin.String value="P(" + CONST String type=kotlin.String value="x=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null - CONST String type=kotlin.String value=", y=" + CONST String type=kotlin.String value=", " + CONST String type=kotlin.String value="y=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.toString' type=.P origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt index a18fa637057..f85a040e351 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt @@ -125,7 +125,7 @@ data class P { } override fun toString(): String { - return "P(x=" + .#x + ", y=" + .#y + ")" + return "P(" + "x=" + .#x + ", " + "y=" + .#y + ")" } } diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt index c786696e6a9..befbc8c2486 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt @@ -87,7 +87,8 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Tag(action=" + CONST String type=kotlin.String value="Tag(" + CONST String type=kotlin.String value="action=" GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null receiver: GET_VAR ': .Tag.Tag> declared in .Tag.toString' type=.Tag.Tag> origin=null CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt index 540e29dfc3b..2cdfff5d69f 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt @@ -37,7 +37,7 @@ data class Tag { } override fun toString(): String { - return "Tag(action=" + .#action + ")" + return "Tag(" + "action=" + .#action + ")" } } 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 99518645b38..11a67b3fd40 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 @@ -21271,12 +21271,6 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() 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 87494e9559d..13778886fa2 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 @@ -21271,12 +21271,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() 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 536f736b899..a9e747a9162 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 @@ -21271,12 +21271,6 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { 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 c8e40811247..bc888712715 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 @@ -24181,12 +24181,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index fa74583e792..1b300d87b00 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -24647,12 +24647,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 31c3d2b1db5..afe30d055fe 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -23949,12 +23949,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index 0c3951b1c96..84396962374 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -24182,12 +24182,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } - @Test - @TestMetadata("thisPlusString.kt") - public void testThisPlusString() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); - } - @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception {