Box/unbox nullable inline class values with null check
When we have a nullable inline class value with non-null underlying type, corresponding value in unboxed representation is nullable. E.g.: inline class Str(val value: String) fun test(s: Str?) = listOf(s) Here 'test(s: Str?)' accepts nullable 'java.lang.String' as a parameter. When boxing/unboxing nullable values of such inline classes, take care of nulls. #KT-26052 Fixed Target versions 1.3-M2
This commit is contained in:
@@ -36,12 +36,14 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.SimpleType;
|
||||
import org.jetbrains.kotlin.types.TypeUtils;
|
||||
import org.jetbrains.org.objectweb.asm.Label;
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static org.jetbrains.kotlin.codegen.AsmUtil.*;
|
||||
import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*;
|
||||
@@ -402,6 +404,21 @@ public abstract class StackValue {
|
||||
Type boxedType = KotlinTypeMapper.mapInlineClassTypeAsDeclaration(kotlinType);
|
||||
Type owner = KotlinTypeMapper.mapToErasedInlineClassType(kotlinType);
|
||||
Type underlyingType = KotlinTypeMapper.mapUnderlyingTypeOfInlineClassType(kotlinType);
|
||||
|
||||
if (TypeUtils.isNullableType(kotlinType) && !isPrimitive(underlyingType)) {
|
||||
boxOrUnboxWithNullCheck(v, vv -> invokeBoxMethod(vv, boxedType, owner, underlyingType));
|
||||
}
|
||||
else {
|
||||
invokeBoxMethod(v, boxedType, owner, underlyingType);
|
||||
}
|
||||
}
|
||||
|
||||
private static void invokeBoxMethod(
|
||||
@NotNull InstructionAdapter v,
|
||||
Type boxedType,
|
||||
Type owner,
|
||||
Type underlyingType
|
||||
) {
|
||||
v.invokestatic(
|
||||
owner.getInternalName(),
|
||||
InlineClassDescriptorResolver.BOX_METHOD_NAME.asString(),
|
||||
@@ -416,6 +433,16 @@ public abstract class StackValue {
|
||||
coerce(type, owner, v);
|
||||
|
||||
Type resultType = KotlinTypeMapper.mapUnderlyingTypeOfInlineClassType(targetInlineClassType);
|
||||
|
||||
if (TypeUtils.isNullableType(targetInlineClassType) && !isPrimitive(type)) {
|
||||
boxOrUnboxWithNullCheck(v, vv -> invokeUnboxMethod(vv, owner, resultType));
|
||||
}
|
||||
else {
|
||||
invokeUnboxMethod(v, owner, resultType);
|
||||
}
|
||||
}
|
||||
|
||||
private static void invokeUnboxMethod(@NotNull InstructionAdapter v, Type owner, Type resultType) {
|
||||
v.invokevirtual(
|
||||
owner.getInternalName(),
|
||||
InlineClassDescriptorResolver.UNBOX_METHOD_NAME.asString(),
|
||||
@@ -424,6 +451,23 @@ public abstract class StackValue {
|
||||
);
|
||||
}
|
||||
|
||||
private static void boxOrUnboxWithNullCheck(@NotNull InstructionAdapter v, @NotNull Consumer<InstructionAdapter> body) {
|
||||
Label lNull = new Label();
|
||||
Label lDone = new Label();
|
||||
// NB The following piece of code looks sub-optimal (we have a 'null' value on stack and could just keep it there),
|
||||
// but it is required, because bytecode verifier doesn't take into account null checks,
|
||||
// and sees null-checked value on the top of the stack as a value of the source type (e.g., Ljava/lang/String;),
|
||||
// which is not assignable to the expected type (destination type, e.g., LStr;).
|
||||
v.dup();
|
||||
v.ifnull(lNull);
|
||||
body.accept(v);
|
||||
v.goTo(lDone);
|
||||
v.mark(lNull);
|
||||
v.pop();
|
||||
v.aconst(null);
|
||||
v.mark(lDone);
|
||||
}
|
||||
|
||||
protected void coerceTo(@NotNull Type toType, @Nullable KotlinType toKotlinType, @NotNull InstructionAdapter v) {
|
||||
coerce(this.type, this.kotlinType, toType, toKotlinType, v);
|
||||
}
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
class BoxT<T>(val boxed: T)
|
||||
class BoxAny(val boxed: Any?)
|
||||
class BoxFoo(val boxed: IFoo?)
|
||||
|
||||
interface IFoo
|
||||
|
||||
inline class Str(val value: String) : IFoo
|
||||
|
||||
inline class Str2(val value: Str): IFoo
|
||||
|
||||
inline class StrArr(val value: Array<String>): IFoo
|
||||
|
||||
fun boxToTypeParameter(x: Str?) = BoxT(x)
|
||||
fun boxToNullableAny(x: Str?) = BoxAny(x)
|
||||
fun boxToNullableInterface(x: Str?) = BoxFoo(x)
|
||||
|
||||
fun box2ToTypeParameter(x: Str2?) = BoxT(x)
|
||||
fun box2ToNullableAny(x: Str2?) = BoxAny(x)
|
||||
fun box2ToNullableInterface(x: Str2?) = BoxFoo(x)
|
||||
|
||||
fun boxArrToTypeParameter(x: StrArr?) = BoxT(x)
|
||||
fun boxArrToNullableAny(x: StrArr?) = BoxAny(x)
|
||||
fun boxArrToNullableInterface(x: StrArr?) = BoxFoo(x)
|
||||
|
||||
fun box(): String {
|
||||
if (boxToNullableAny(null).boxed != null) throw AssertionError()
|
||||
if (boxToTypeParameter(null).boxed != null) throw AssertionError()
|
||||
if (boxToNullableInterface(null).boxed != null) throw AssertionError()
|
||||
|
||||
if (box2ToNullableAny(null).boxed != null) throw AssertionError()
|
||||
if (box2ToTypeParameter(null).boxed != null) throw AssertionError()
|
||||
if (box2ToNullableInterface(null).boxed != null) throw AssertionError()
|
||||
|
||||
if (boxArrToNullableAny(null).boxed != null) throw AssertionError()
|
||||
if (boxArrToTypeParameter(null).boxed != null) throw AssertionError()
|
||||
if (boxArrToNullableInterface(null).boxed != null) throw AssertionError()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
class BoxT<T>(val boxed: T)
|
||||
class BoxAny(val boxed: Any?)
|
||||
class BoxFoo(val boxed: IFoo?)
|
||||
|
||||
interface IFoo
|
||||
|
||||
inline class I32(val value: Int): IFoo
|
||||
|
||||
fun boxToTypeParameter(x: I32?) = BoxT(x)
|
||||
fun boxToNullableAny(x: I32?) = BoxAny(x)
|
||||
fun boxToNullableInterface(x: I32?) = BoxFoo(x)
|
||||
|
||||
fun box(): String {
|
||||
if (boxToNullableAny(null).boxed != null) throw AssertionError()
|
||||
if (boxToTypeParameter(null).boxed != null) throw AssertionError()
|
||||
if (boxToNullableInterface(null).boxed != null) throw AssertionError()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR
|
||||
|
||||
inline class X(val x: String)
|
||||
inline class Y(val y: Number)
|
||||
|
||||
inline class NX(val x: String?)
|
||||
inline class NY(val y: Number?)
|
||||
|
||||
fun testNotNull(x: X?, y: Y?) {
|
||||
val xs = listOf<Any?>(x)
|
||||
val ys = listOf<Any?>(y)
|
||||
if (!xs.contains(y)) throw AssertionError()
|
||||
if (xs[0] != ys[0]) throw AssertionError()
|
||||
if (xs[0] !== ys[0]) throw AssertionError()
|
||||
}
|
||||
|
||||
fun testNullable(x: NX?, y: NY?) {
|
||||
val xs = listOf<Any?>(x)
|
||||
val ys = listOf<Any?>(y)
|
||||
if (xs.contains(y)) throw AssertionError()
|
||||
if (xs[0] == ys[0]) throw AssertionError()
|
||||
if (xs[0] === ys[0]) throw AssertionError()
|
||||
}
|
||||
|
||||
fun testNullsAsNullable(x: NX?, y: NY?) {
|
||||
val xs = listOf<Any?>(x)
|
||||
val ys = listOf<Any?>(y)
|
||||
if (!xs.contains(y)) throw AssertionError()
|
||||
if (xs[0] != ys[0]) throw AssertionError()
|
||||
if (xs[0] !== ys[0]) throw AssertionError()
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
testNotNull(null, null)
|
||||
|
||||
testNullable(NX(null), NY(null))
|
||||
testNullable(NX(null), null)
|
||||
testNullable(null, NY(null))
|
||||
|
||||
testNullsAsNullable(null, null)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR, JS
|
||||
// IGNORE_BACKEND: JVM_IR, JS
|
||||
|
||||
inline class Z(val value: Int)
|
||||
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
class BoxT<T>(val boxed: T)
|
||||
class BoxAny(val boxed: Any?)
|
||||
class BoxFoo(val boxed: IFoo?)
|
||||
|
||||
interface IFoo
|
||||
|
||||
inline class Str(val value: String) : IFoo
|
||||
|
||||
inline class Str2(val value: Str): IFoo
|
||||
|
||||
inline class StrArr(val value: Array<String>): IFoo
|
||||
|
||||
fun boxToTypeParameter(x: Str?) = BoxT(x)
|
||||
fun boxToNullableAny(x: Str?) = BoxAny(x)
|
||||
fun boxToNullableInterface(x: Str?) = BoxFoo(x)
|
||||
|
||||
fun box2ToTypeParameter(x: Str2?) = BoxT(x)
|
||||
fun box2ToNullableAny(x: Str2?) = BoxAny(x)
|
||||
fun box2ToNullableInterface(x: Str2?) = BoxFoo(x)
|
||||
|
||||
fun boxArrToTypeParameter(x: StrArr?) = BoxT(x)
|
||||
fun boxArrToNullableAny(x: StrArr?) = BoxAny(x)
|
||||
fun boxArrToNullableInterface(x: StrArr?) = BoxFoo(x)
|
||||
|
||||
fun useNullableStr(x: Str?) {
|
||||
if (x != null) throw AssertionError()
|
||||
}
|
||||
|
||||
fun useNullableStr2(x: Str2?) {
|
||||
if (x != null) throw AssertionError()
|
||||
}
|
||||
|
||||
fun useNullableStrArr(x: StrArr?) {
|
||||
if (x != null) throw AssertionError()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
useNullableStr(boxToTypeParameter(null).boxed)
|
||||
useNullableStr(boxToNullableAny(null).boxed as Str?)
|
||||
useNullableStr(boxToNullableInterface(null).boxed as Str?)
|
||||
|
||||
useNullableStr2(box2ToTypeParameter(null).boxed)
|
||||
useNullableStr2(box2ToNullableAny(null).boxed as Str2?)
|
||||
useNullableStr2(box2ToNullableInterface(null).boxed as Str2?)
|
||||
|
||||
useNullableStrArr(boxArrToTypeParameter(null).boxed)
|
||||
useNullableStrArr(boxArrToNullableAny(null).boxed as StrArr?)
|
||||
useNullableStrArr(boxArrToNullableInterface(null).boxed as StrArr?)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
class BoxT<T>(val boxed: T)
|
||||
class BoxAny(val boxed: Any?)
|
||||
class BoxFoo(val boxed: IFoo?)
|
||||
|
||||
interface IFoo
|
||||
|
||||
inline class I32(val value: Int) : IFoo
|
||||
|
||||
fun boxToTypeParameter(x: I32?) = BoxT(x)
|
||||
fun boxToNullableAny(x: I32?) = BoxAny(x)
|
||||
fun boxToNullableInterface(x: I32?) = BoxFoo(x)
|
||||
|
||||
fun useNullableI32(x: I32?) {
|
||||
if (x != null) throw AssertionError()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
useNullableI32(boxToTypeParameter(null).boxed)
|
||||
useNullableI32(boxToNullableAny(null).boxed as I32?)
|
||||
useNullableI32(boxToNullableInterface(null).boxed as I32?)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+25
@@ -11333,6 +11333,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxUnboxInlineClassesWithOperatorsGetSet.kt")
|
||||
public void testBoxUnboxInlineClassesWithOperatorsGetSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt");
|
||||
@@ -11468,6 +11478,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalityForBoxesOfNullableValuesOfInlineClass.kt")
|
||||
public void testEqualityForBoxesOfNullableValuesOfInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
|
||||
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
|
||||
@@ -11573,6 +11588,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxReceiverOnCallingMethodFromInlineClass.kt")
|
||||
public void testUnboxReceiverOnCallingMethodFromInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt");
|
||||
|
||||
+25
@@ -11333,6 +11333,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxUnboxInlineClassesWithOperatorsGetSet.kt")
|
||||
public void testBoxUnboxInlineClassesWithOperatorsGetSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt");
|
||||
@@ -11468,6 +11478,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalityForBoxesOfNullableValuesOfInlineClass.kt")
|
||||
public void testEqualityForBoxesOfNullableValuesOfInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
|
||||
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
|
||||
@@ -11573,6 +11588,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxReceiverOnCallingMethodFromInlineClass.kt")
|
||||
public void testUnboxReceiverOnCallingMethodFromInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt");
|
||||
|
||||
+25
@@ -11333,6 +11333,16 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxUnboxInlineClassesWithOperatorsGetSet.kt")
|
||||
public void testBoxUnboxInlineClassesWithOperatorsGetSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt");
|
||||
@@ -11468,6 +11478,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalityForBoxesOfNullableValuesOfInlineClass.kt")
|
||||
public void testEqualityForBoxesOfNullableValuesOfInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
|
||||
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
|
||||
@@ -11573,6 +11588,16 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxReceiverOnCallingMethodFromInlineClass.kt")
|
||||
public void testUnboxReceiverOnCallingMethodFromInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt");
|
||||
|
||||
+25
@@ -9918,6 +9918,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxUnboxInlineClassesWithOperatorsGetSet.kt")
|
||||
public void testBoxUnboxInlineClassesWithOperatorsGetSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt");
|
||||
@@ -10048,6 +10058,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalityForBoxesOfNullableValuesOfInlineClass.kt")
|
||||
public void testEqualityForBoxesOfNullableValuesOfInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
|
||||
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
|
||||
@@ -10148,6 +10163,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxReceiverOnCallingMethodFromInlineClass.kt")
|
||||
public void testUnboxReceiverOnCallingMethodFromInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt");
|
||||
|
||||
+25
@@ -10968,6 +10968,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxUnboxInlineClassesWithOperatorsGetSet.kt")
|
||||
public void testBoxUnboxInlineClassesWithOperatorsGetSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt");
|
||||
@@ -11098,6 +11108,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalityForBoxesOfNullableValuesOfInlineClass.kt")
|
||||
public void testEqualityForBoxesOfNullableValuesOfInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassAsLastExpressionInInLambda.kt")
|
||||
public void testInlineClassAsLastExpressionInInLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt");
|
||||
@@ -11198,6 +11213,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt")
|
||||
public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unboxReceiverOnCallingMethodFromInlineClass.kt")
|
||||
public void testUnboxReceiverOnCallingMethodFromInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user