diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java index 53b9af7a2ee..5e3b51576cd 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java @@ -44,6 +44,7 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin; import org.jetbrains.kotlin.serialization.DescriptorSerializer; import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor; import org.jetbrains.kotlin.types.KotlinType; +import org.jetbrains.kotlin.types.SimpleType; import org.jetbrains.org.objectweb.asm.*; import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter; import org.jetbrains.org.objectweb.asm.commons.Method; @@ -527,15 +528,38 @@ public class AsmUtil { v.invokespecial("java/lang/StringBuilder", "", "()V", false); } - public static void genInvokeAppendMethod(InstructionAdapter v, Type type) { - type = stringBuilderAppendType(type); - v.invokevirtual("java/lang/StringBuilder", "append", "(" + type.getDescriptor() + ")Ljava/lang/StringBuilder;", false); + public static void genInvokeAppendMethod(@NotNull InstructionAdapter v, @NotNull Type type, @Nullable KotlinType kotlinType) { + Type appendParameterType; + if (kotlinType != null && InlineClassesUtilsKt.isInlineClassType(kotlinType)) { + appendParameterType = OBJECT_TYPE; + SimpleType nullableAnyType = kotlinType.getConstructor().getBuiltIns().getNullableAnyType(); + StackValue.coerce(type, kotlinType, appendParameterType, nullableAnyType, v); + } + else { + appendParameterType = stringBuilderAppendType(type); + } + + v.invokevirtual("java/lang/StringBuilder", "append", "(" + appendParameterType.getDescriptor() + ")Ljava/lang/StringBuilder;", false); } - public static StackValue genToString(StackValue receiver, Type receiverType) { + public static StackValue genToString( + @NotNull StackValue receiver, + @NotNull Type receiverType, + @Nullable KotlinType receiverKotlinType + ) { return StackValue.operation(JAVA_STRING_TYPE, v -> { - Type type = stringValueOfType(receiverType); - receiver.put(type, v); + Type type; + KotlinType kotlinType; + if (receiverKotlinType != null && InlineClassesUtilsKt.isInlineClassType(receiverKotlinType)) { + type = OBJECT_TYPE; + kotlinType = receiverKotlinType.getConstructor().getBuiltIns().getNullableAnyType(); + } + else { + type = stringValueOfType(receiverType); + kotlinType = null; + } + + receiver.put(type, kotlinType, v); v.invokestatic("java/lang/String", "valueOf", "(" + type.getDescriptor() + ")Ljava/lang/String;", false); return null; }); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index c2d94e59f94..12bbca949a0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -808,7 +808,7 @@ public class ExpressionCodegen extends KtVisitor impleme StringTemplateEntry entry = entries.get(0); if (entry instanceof StringTemplateEntry.Expression) { KtExpression expr = ((StringTemplateEntry.Expression) entry).expression; - return genToString(gen(expr), expressionType(expr)); + return genToString(gen(expr), expressionType(expr), kotlinType(expr)); } else { return StackValue.constant(((StringTemplateEntry.Constant) entry).value, type); @@ -833,11 +833,11 @@ public class ExpressionCodegen extends KtVisitor impleme String value = ((StringTemplateEntry.Constant) entry).value; if (value.length() == 1) { v.iconst(value.charAt(0)); - genInvokeAppendMethod(v, Type.CHAR_TYPE); + genInvokeAppendMethod(v, Type.CHAR_TYPE, null); } else { v.aconst(value); - genInvokeAppendMethod(v, JAVA_STRING_TYPE); + genInvokeAppendMethod(v, JAVA_STRING_TYPE, null); } } } @@ -3739,11 +3739,12 @@ public class ExpressionCodegen extends KtVisitor impleme Type exprType = expressionType(expr); KotlinType exprKotlinType = kotlinType(expr); if (compileTimeConstant != null) { - StackValue.constant(compileTimeConstant.getValue(), exprType).put(exprType, null, v); + StackValue.constant(compileTimeConstant.getValue(), exprType, exprKotlinType).put(exprType, exprKotlinType, v); } else { gen(expr, exprType, exprKotlinType); } - genInvokeAppendMethod(v, exprType.getSort() == Type.ARRAY ? OBJECT_TYPE : exprType); + + genInvokeAppendMethod(v, exprType.getSort() == Type.ARRAY ? OBJECT_TYPE : exprType, exprKotlinType); } @Nullable diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 225163bfbf9..66bc03f546e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -518,7 +518,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } } - public Type genPropertyOnStack( + public JvmKotlinType genPropertyOnStack( InstructionAdapter iv, MethodContext context, @NotNull PropertyDescriptor propertyDescriptor, @@ -528,16 +528,19 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { iv.load(index, classAsmType); if (couldUseDirectAccessToProperty(propertyDescriptor, /* forGetter = */ true, /* isDelegated = */ false, context, state.getShouldInlineConstVals())) { - Type type = typeMapper.mapType(propertyDescriptor.getType()); + KotlinType kotlinType = propertyDescriptor.getType(); + Type type = typeMapper.mapType(kotlinType); String fieldName = ((FieldOwnerContext) context.getParentContext()).getFieldName(propertyDescriptor, false); iv.getfield(classAsmType.getInternalName(), fieldName, type.getDescriptor()); - return type; + return new JvmKotlinType(type, kotlinType); } else { + PropertyGetterDescriptor getter = propertyDescriptor.getGetter(); + //noinspection ConstantConditions - Method method = typeMapper.mapAsmMethod(propertyDescriptor.getGetter()); + Method method = typeMapper.mapAsmMethod(getter); iv.invokevirtual(classAsmType.getInternalName(), method.getName(), method.getDescriptor(), false); - return method.getReturnType(); + return new JvmKotlinType(method.getReturnType(), getter.getReturnType()); } } @@ -582,11 +585,11 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { KotlinType kotlinType = propertyDescriptor.getReturnType(); Type asmType = typeMapper.mapType(kotlinType); - Type thisPropertyType = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 0); - StackValue.coerce(thisPropertyType, asmType, iv); + JvmKotlinType thisPropertyType = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 0); + StackValue.coerce(thisPropertyType.getType(), thisPropertyType.getKotlinType(), asmType, kotlinType, iv); - Type otherPropertyType = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 2); - StackValue.coerce(otherPropertyType, asmType, iv); + JvmKotlinType otherPropertyType = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 2); + StackValue.coerce(otherPropertyType.getType(), otherPropertyType.getKotlinType(), asmType, kotlinType, iv); if (asmType.getSort() == Type.FLOAT) { iv.invokestatic("java/lang/Float", "compare", "(FF)I", false); @@ -630,9 +633,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { iv.mul(Type.INT_TYPE); } - Type propertyType = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 0); - Type asmType = typeMapper.mapType(propertyDescriptor); - StackValue.coerce(propertyType, asmType, iv); + JvmKotlinType propertyType = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 0); + KotlinType kotlinType = propertyDescriptor.getReturnType(); + Type asmType = typeMapper.mapType(kotlinType); + StackValue.coerce(propertyType.getType(), propertyType.getKotlinType(), asmType, kotlinType, iv); Label ifNull = null; if (!isPrimitive(asmType)) { @@ -684,28 +688,29 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { else { iv.aconst(", " + propertyDescriptor.getName().asString() + "="); } - genInvokeAppendMethod(iv, JAVA_STRING_TYPE); + genInvokeAppendMethod(iv, JAVA_STRING_TYPE, null); - Type type = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 0); + JvmKotlinType type = genPropertyOnStack(iv, context, propertyDescriptor, ImplementationBodyCodegen.this.classAsmType, 0); + Type asmType = type.getType(); - if (type.getSort() == Type.ARRAY) { - Type elementType = correctElementType(type); + if (asmType.getSort() == Type.ARRAY) { + Type elementType = correctElementType(asmType); if (elementType.getSort() == Type.OBJECT || elementType.getSort() == Type.ARRAY) { iv.invokestatic("java/util/Arrays", "toString", "([Ljava/lang/Object;)Ljava/lang/String;", false); - type = JAVA_STRING_TYPE; + asmType = JAVA_STRING_TYPE; } else { if (elementType.getSort() != Type.CHAR) { - iv.invokestatic("java/util/Arrays", "toString", "(" + type.getDescriptor() + ")Ljava/lang/String;", false); - type = JAVA_STRING_TYPE; + iv.invokestatic("java/util/Arrays", "toString", "(" + asmType.getDescriptor() + ")Ljava/lang/String;", false); + asmType = JAVA_STRING_TYPE; } } } - genInvokeAppendMethod(iv, type); + genInvokeAppendMethod(iv, asmType, type.getKotlinType()); } iv.aconst(")"); - genInvokeAppendMethod(iv, JAVA_STRING_TYPE); + genInvokeAppendMethod(iv, JAVA_STRING_TYPE, null); iv.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false); iv.areturn(JAVA_STRING_TYPE); @@ -732,8 +737,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, descriptorToDeclaration(parameter)); assert property != null : "Property descriptor is not found for primary constructor parameter: " + parameter; - Type propertyType = genPropertyOnStack(iv, context, property, ImplementationBodyCodegen.this.classAsmType, 0); - StackValue.coerce(propertyType, componentType, iv); + JvmKotlinType propertyType = genPropertyOnStack(iv, context, property, ImplementationBodyCodegen.this.classAsmType, 0); + StackValue.coerce(propertyType.getType(), componentType, iv); } iv.areturn(componentType); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java index ae6c3e0147c..e0d2af05645 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java @@ -1456,7 +1456,7 @@ public abstract class StackValue { if (getter == null) { assert fieldName != null : "Property should have either a getter or a field name: " + descriptor; assert backingFieldOwner != null : "Property should have either a getter or a backingFieldOwner: " + descriptor; - if (inlineConstantIfNeeded(type, v)) return; + if (inlineConstantIfNeeded(type, kotlinType, v)) return; v.visitFieldInsn(isStaticPut ? GETSTATIC : GETFIELD, backingFieldOwner.getInternalName(), fieldName, this.type.getDescriptor()); @@ -1499,19 +1499,19 @@ public abstract class StackValue { } } - private boolean inlineConstantIfNeeded(@NotNull Type type, @NotNull InstructionAdapter v) { + private boolean inlineConstantIfNeeded(@NotNull Type type, @Nullable KotlinType kotlinType, @NotNull InstructionAdapter v) { if (JvmCodegenUtil.isInlinedJavaConstProperty(descriptor)) { - return inlineConstant(type, v); + return inlineConstant(type, kotlinType, v); } if (descriptor.isConst() && codegen.getState().getShouldInlineConstVals()) { - return inlineConstant(type, v); + return inlineConstant(type, kotlinType, v); } return false; } - private boolean inlineConstant(@NotNull Type type, @NotNull InstructionAdapter v) { + private boolean inlineConstant(@NotNull Type type, @Nullable KotlinType kotlinType, @NotNull InstructionAdapter v) { assert AsmUtil.isPrimitive(this.type) || AsmTypes.JAVA_STRING_TYPE.equals(this.type) : "Const property should have primitive or string type: " + descriptor; assert isStaticPut : "Const property should be static" + descriptor; @@ -1524,7 +1524,7 @@ public abstract class StackValue { value = ((Double) value).floatValue(); } - StackValue.constant(value, this.type).putSelector(type, null, v); + StackValue.constant(value, this.type, this.kotlinType).putSelector(type, kotlinType, v); return true; } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Concat.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Concat.kt index b590386f20b..e3196817d3b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Concat.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Concat.kt @@ -50,7 +50,7 @@ class Concat : IntrinsicMethod() { receiver.put(AsmTypes.JAVA_STRING_TYPE, v) genStringBuilderConstructor(v) v.swap() - genInvokeAppendMethod(v, returnType) + genInvokeAppendMethod(v, returnType, null) codegen.invokeAppend(v, arguments[0]) } @@ -92,7 +92,7 @@ class Concat : IntrinsicMethod() { // in case of callable reference passed to a generic function, e.g.: // charArrayOf('O', 'K').fold("", String::plus) // TODO Make String::plus generic, and invoke proper StringBuilder#append. - AsmUtil.genInvokeAppendMethod(v, AsmTypes.OBJECT_TYPE) + AsmUtil.genInvokeAppendMethod(v, AsmTypes.OBJECT_TYPE, null) v.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false) } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index 51d173b4a0e..5e66f0b682e 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -647,7 +647,8 @@ class ExpressionCodegen( override fun visitStringConcatenation(expression: IrStringConcatenation, data: BlockInfo): StackValue { AsmUtil.genStringBuilderConstructor(mv) expression.arguments.forEach { - AsmUtil.genInvokeAppendMethod(mv, gen(it, data).type) + val stackValue = gen(it, data) + AsmUtil.genInvokeAppendMethod(mv, stackValue.type, stackValue.kotlinType) } mv.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/Concat.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/Concat.kt index 88160866b95..e39c131c82a 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/Concat.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/Concat.kt @@ -56,7 +56,7 @@ class Concat : IntrinsicMethod() { receiver.put(AsmTypes.OBJECT_TYPE, v) genStringBuilderConstructor(v) v.swap() - genInvokeAppendMethod(v, returnType) + genInvokeAppendMethod(v, returnType, null) codegen.invokeAppend(v, arguments.get(0)) } @@ -71,7 +71,7 @@ class Concat : IntrinsicMethod() { return object : IrIntrinsicFunction(expression, signature, context, argsTypes) { override fun genInvokeInstruction(v: InstructionAdapter) { - AsmUtil.genInvokeAppendMethod(v, argsTypes[1]) + AsmUtil.genInvokeAppendMethod(v, argsTypes[1], null) v.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false) } @@ -126,7 +126,7 @@ class Concat : IntrinsicMethod() { // in case of callable reference passed to a generic function, e.g.: // charArrayOf('O', 'K').fold("", String::plus) // TODO Make String::plus generic, and invoke proper StringBuilder#append. - AsmUtil.genInvokeAppendMethod(v, AsmTypes.OBJECT_TYPE) + AsmUtil.genInvokeAppendMethod(v, AsmTypes.OBJECT_TYPE, null) v.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false) } } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt new file mode 100644 index 00000000000..af9b3ed73f8 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt @@ -0,0 +1,31 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR + +inline class Augmented(val x: Int) { + override fun toString(): String = (x + 1).toString() +} + +inline class AsAny(val a: Any) { + override fun toString(): String = "AsAny: $a" +} + +data class AugmentedAndAsAny(val a: Augmented, val b: AsAny) + +fun box(): String { + val a = Augmented(0) + val single = "$a" + if (single != "1") return "Fail 1: $single" + + val asAny = AsAny(42) + val asAnyString = "$asAny" + if (asAnyString != "AsAny: 42") return "Fail 2: $asAnyString" + + val b = Augmented(1) + val two = "$a and $b" + if (two != "1 and 2") return "Fail 3: $two" + + val d = AugmentedAndAsAny(a, asAny) + if (d.toString() != "AugmentedAndAsAny(a=1, b=AsAny: 42)") return "Fail 4: $d" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt b/compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt new file mode 100644 index 00000000000..ca613fe7322 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt @@ -0,0 +1,15 @@ +// WITH_UNSIGNED +// IGNORE_BACKEND: JVM_IR, JS_IR, JS + +const val maxUByte: UByte = 0xFFu + +fun custom(a: Any): String { + return "Custom: $a, isUByte: ${a is UByte}" +} + +fun box(): String { + val result = custom(maxUByte) + if (result != "Custom: 255, isUByte: true") return "Fail: $result" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt new file mode 100644 index 00000000000..a9fe317f0d2 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt @@ -0,0 +1,22 @@ +// WITH_UNSIGNED +// IGNORE_BACKEND: JVM_IR, JS_IR, JS + +const val MAX_BYTE: UByte = 0xFFu +const val HUNDRED: UByte = 100u + +fun box(): String { + val maxByteStringSingle = "$MAX_BYTE" + if (maxByteStringSingle != MAX_BYTE.toString() || maxByteStringSingle != "255") return "Fail 1: $maxByteStringSingle" + + val twoHundredUByte = "${(HUNDRED * 2u).toUByte()}" + if (twoHundredUByte != "200") return "Fail 2: $twoHundredUByte" + + val complexOnlyConstants = "Max: $MAX_BYTE, two hundred: $twoHundredUByte" + if (complexOnlyConstants != "Max: 255, two hundred: 200") return "Fail 3: $complexOnlyConstants" + + val nonConst = UByte.MAX_VALUE + 1u + val complex = "Max UByte: $MAX_BYTE, next: $nonConst" + if (complex != "Max UByte: 255, next: 256") return "Fail 4: $complex" + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 99ded83e538..aa7720282a3 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -11236,6 +11236,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt"); } + @TestMetadata("inlineClassValuesInsideStrings.kt") + public void testInlineClassValuesInsideStrings() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt"); + } + @TestMetadata("inlineClassesCheckCast.kt") public void testInlineClassesCheckCast() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt"); @@ -21445,6 +21450,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } + @TestMetadata("boxConstValOfUnsignedType.kt") + public void testBoxConstValOfUnsignedType() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt"); + } + @TestMetadata("checkBasicUnsignedLiterals.kt") public void testCheckBasicUnsignedLiterals() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/checkBasicUnsignedLiterals.kt"); @@ -21470,6 +21480,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedTypeValuesInsideStringTemplates.kt") + public void testUnsignedTypeValuesInsideStringTemplates() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt"); + } + @TestMetadata("varargsOfUnsignedTypes.kt") public void testVarargsOfUnsignedTypes() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/varargsOfUnsignedTypes.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index f775fc94b1c..556eecbe687 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -11236,6 +11236,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt"); } + @TestMetadata("inlineClassValuesInsideStrings.kt") + public void testInlineClassValuesInsideStrings() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt"); + } + @TestMetadata("inlineClassesCheckCast.kt") public void testInlineClassesCheckCast() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt"); @@ -21445,6 +21450,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("boxConstValOfUnsignedType.kt") + public void testBoxConstValOfUnsignedType() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt"); + } + @TestMetadata("checkBasicUnsignedLiterals.kt") public void testCheckBasicUnsignedLiterals() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/checkBasicUnsignedLiterals.kt"); @@ -21470,6 +21480,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedTypeValuesInsideStringTemplates.kt") + public void testUnsignedTypeValuesInsideStringTemplates() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt"); + } + @TestMetadata("varargsOfUnsignedTypes.kt") public void testVarargsOfUnsignedTypes() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/varargsOfUnsignedTypes.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index edbfbbe566e..3a1bf5bc3a6 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -11236,6 +11236,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt"); } + @TestMetadata("inlineClassValuesInsideStrings.kt") + public void testInlineClassValuesInsideStrings() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt"); + } + @TestMetadata("inlineClassesCheckCast.kt") public void testInlineClassesCheckCast() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt"); @@ -21445,6 +21450,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("boxConstValOfUnsignedType.kt") + public void testBoxConstValOfUnsignedType() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt"); + } + @TestMetadata("checkBasicUnsignedLiterals.kt") public void testCheckBasicUnsignedLiterals() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/checkBasicUnsignedLiterals.kt"); @@ -21470,6 +21480,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedTypeValuesInsideStringTemplates.kt") + public void testUnsignedTypeValuesInsideStringTemplates() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt"); + } + @TestMetadata("varargsOfUnsignedTypes.kt") public void testVarargsOfUnsignedTypes() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/varargsOfUnsignedTypes.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index 0c65197a3c7..f3a0f5db315 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -9861,6 +9861,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt"); } + @TestMetadata("inlineClassValuesInsideStrings.kt") + public void testInlineClassValuesInsideStrings() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt"); + } + @TestMetadata("inlineClassesCheckCast.kt") public void testInlineClassesCheckCast() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt"); @@ -19385,6 +19390,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } + @TestMetadata("boxConstValOfUnsignedType.kt") + public void testBoxConstValOfUnsignedType() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt"); @@ -19395,6 +19405,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverListOfBoxedUnsignedValues.kt"); } + @TestMetadata("unsignedTypeValuesInsideStringTemplates.kt") + public void testUnsignedTypeValuesInsideStringTemplates() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt"); + } + @TestMetadata("varargsOfUnsignedTypes.kt") public void testVarargsOfUnsignedTypes() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/varargsOfUnsignedTypes.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index ce2043ab6b3..9cd5507af13 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -10866,6 +10866,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt"); } + @TestMetadata("inlineClassValuesInsideStrings.kt") + public void testInlineClassValuesInsideStrings() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt"); + } + @TestMetadata("inlineClassesCheckCast.kt") public void testInlineClassesCheckCast() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt"); @@ -20390,6 +20395,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } + @TestMetadata("boxConstValOfUnsignedType.kt") + public void testBoxConstValOfUnsignedType() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/boxConstValOfUnsignedType.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt"); @@ -20400,6 +20410,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverListOfBoxedUnsignedValues.kt"); } + @TestMetadata("unsignedTypeValuesInsideStringTemplates.kt") + public void testUnsignedTypeValuesInsideStringTemplates() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedTypeValuesInsideStringTemplates.kt"); + } + @TestMetadata("varargsOfUnsignedTypes.kt") public void testVarargsOfUnsignedTypes() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/varargsOfUnsignedTypes.kt");