JVM IR: Fix handling of anonymous initializers in inline classes (#4372)

Fixes KT-46554
This commit is contained in:
Steven Schäfer
2021-05-11 11:42:11 +02:00
committed by Alexander Udalov
parent cc4c61d2b3
commit b2378620c3
14 changed files with 320 additions and 51 deletions
@@ -25,6 +25,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@@ -17744,6 +17750,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@Test
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@Test
@TestMetadata("classLiteralOnInlineClass.kt")
public void testClassLiteralOnInlineClass() throws Exception {
@@ -17972,6 +17984,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@Test
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@Test
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
@@ -17984,6 +18002,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt");
}
@Test
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@Test
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
@@ -18374,6 +18398,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@Test
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@Test
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
@@ -186,7 +186,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
returnType = source.returnType
}.apply {
copyParameterDeclarationsFrom(source)
annotations += source.annotations
annotations = source.annotations
parent = source.parent
// We need to ensure that this bridge has the same attribute owner as its static inline class replacement, since this
// is used in [CoroutineCodegen.isStaticInlineClassReplacementDelegatingCall] to identify the bridge and avoid generating
@@ -391,13 +391,9 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
when {
// Getting the underlying field of an inline class merely changes the IR type,
// since the underlying representations are the same.
expression.symbol.owner.isInlineClassFieldGetter -> when (val ctor = findInitBlockOrConstructorImpl()) {
InitBlockOrConstructorImpl.InitBlock -> super.visitCall(expression)
is InitBlockOrConstructorImpl.ConstructorImpl -> getConstructorImplArgumentValue(ctor, expression.type)
else -> {
val arg = expression.dispatchReceiver!!.transform(this, null)
coerceInlineClasses(arg, expression.symbol.owner.dispatchReceiverParameter!!.type, expression.type)
}
expression.symbol.owner.isInlineClassFieldGetter -> {
val arg = expression.dispatchReceiver!!.transform(this, null)
coerceInlineClasses(arg, expression.symbol.owner.dispatchReceiverParameter!!.type, expression.type)
}
// Specialize calls to equals when the left argument is a value of inline class type.
expression.isSpecializedInlineClassEqEq -> {
@@ -410,24 +406,6 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
super.visitCall(expression)
}
private fun getConstructorImplArgumentValue(ctor: InitBlockOrConstructorImpl.ConstructorImpl, expectedType: IrType): IrExpression {
val arg: IrValueParameter = ctor.irElement.valueParameters.single()
return coerceInlineClasses(IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, arg.symbol), arg.type, expectedType)
}
@Suppress("UNCHECKED_CAST")
private fun findInitBlockOrConstructorImpl(): InitBlockOrConstructorImpl? {
for (scope in allScopes.reversed()) {
val irElement = scope.irElement
when {
irElement is IrAnonymousInitializer -> return InitBlockOrConstructorImpl.InitBlock
irElement is IrFunction && irElement.origin == JvmLoweredDeclarationOrigin.STATIC_INLINE_CLASS_CONSTRUCTOR ->
return InitBlockOrConstructorImpl.ConstructorImpl(irElement)
}
}
return null
}
private val IrCall.isSpecializedInlineClassEqEq: Boolean
get() {
// Note that reference equality (x === y) is not allowed on values of inline class type,
@@ -490,13 +468,6 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
it.type, it.symbol, expression.origin
)
}
val owner = expression.symbol.owner
if (owner is IrValueParameter && (owner.parent as? IrClass)?.isInline == true && owner.origin == IrDeclarationOrigin.INSTANCE_RECEIVER) {
val ctor = findInitBlockOrConstructorImpl()
if (ctor is InitBlockOrConstructorImpl.ConstructorImpl) {
return getConstructorImplArgumentValue(ctor, expression.type)
}
}
return super.visitGetValue(expression)
}
@@ -512,6 +483,13 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
return super.visitSetValue(expression)
}
// Anonymous initializers in inline classes are processed when building the primary constructor.
override fun visitAnonymousInitializerNew(declaration: IrAnonymousInitializer): IrStatement {
if (declaration.parent.safeAs<IrClass>()?.isInline == true)
return declaration
return super.visitAnonymousInitializerNew(declaration)
}
private fun buildPrimaryInlineClassConstructor(irClass: IrClass, irConstructor: IrConstructor) {
// Add the default primary constructor
irClass.addConstructor {
@@ -523,7 +501,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
// Don't create a default argument stub for the primary constructor
irConstructor.valueParameters.forEach { it.defaultValue = null }
copyParameterDeclarationsFrom(irConstructor)
annotations += irConstructor.annotations
annotations = irConstructor.annotations
body = context.createIrBuilder(this.symbol).irBlockBody(this) {
+irDelegatingConstructorCall(context.irBuiltIns.anyClass.owner.constructors.single())
+irSetField(
@@ -534,27 +512,26 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
}
}
// Add a static bridge method to the primary constructor.
// This is a placeholder for null-checks and default arguments.
// Add a static bridge method to the primary constructor. This contains
// null-checks, default arguments, and anonymous initializers.
val function = context.inlineClassReplacements.getReplacementFunction(irConstructor)!!
val initBlocks = irClass.declarations.filterIsInstance<IrAnonymousInitializer>()
function.valueParameters.forEach { it.transformChildrenVoid() }
with(context.createIrBuilder(function.symbol)) {
val argument: IrValueParameter = function.valueParameters[0]
function.body = irBlockBody {
for (initBlock in initBlocks) {
for (stmt in initBlock.body.statements) {
+stmt
}
function.body = context.createIrBuilder(function.symbol).irBlockBody {
val argument = function.valueParameters[0]
val thisValue = irTemporary(coerceInlineClasses(irGet(argument), argument.type, function.returnType))
valueMap[irClass.thisReceiver!!.symbol] = thisValue
for (initBlock in initBlocks) {
for (stmt in initBlock.body.statements) {
+stmt.transformStatement(this@JvmInlineClassLowering).patchDeclarationParents(function)
}
+irReturn(coerceInlineClasses(irGet(argument), argument.type, function.returnType))
}
+irReturn(irGet(thisValue))
}
function.accept(this, null)
irClass.declarations.removeAll(initBlocks)
irClass.declarations.removeAll(initBlocks)
irClass.declarations += function
}
@@ -601,8 +578,3 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
irClass.declarations += function
}
}
private sealed class InitBlockOrConstructorImpl {
object InitBlock : InitBlockOrConstructorImpl()
class ConstructorImpl(val irElement: IrFunction) : InitBlockOrConstructorImpl()
}
@@ -0,0 +1,21 @@
inline class IC private constructor(val i: Int) {
@Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS")
constructor() : this(0) {
counter += 1
}
}
var counter = 0
fun <T> id(t: T) = t
fun box(): String {
val ic = IC()
if (counter != 1) return "FAIL 1: $counter"
counter = 0
id(ic)
if (counter != 0) return "FAIL 2: $counter"
return "OK"
}
@@ -0,0 +1,17 @@
var result = "Fail"
inline class A(val value: String) {
init {
class B {
init {
result = value
}
}
B()
}
}
fun box(): String {
A("OK")
return result
}
@@ -0,0 +1,14 @@
var result = "Fail"
inline class A(val value: String)
inline class B(val a: A) {
init {
result = a.value
}
}
fun box(): String {
B(A("OK"))
return result
}
@@ -0,0 +1,16 @@
var result = "Fail"
inline class A(val value: String) {
fun f() = value + "K"
}
class B(val a: A) {
val result: String
init {
result = a.f()
}
}
fun box(): String {
return B(A("O")).result
}
+14
View File
@@ -0,0 +1,14 @@
var result = "Fail"
inline class A(val value: String) {
constructor() : this("OK")
init {
result = value
}
}
fun box(): String {
A()
return result
}
@@ -25,6 +25,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@@ -17720,6 +17726,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@Test
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@Test
@TestMetadata("classLiteralOnInlineClass.kt")
public void testClassLiteralOnInlineClass() throws Exception {
@@ -17948,6 +17960,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@Test
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@Test
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
@@ -17960,6 +17978,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt");
}
@Test
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@Test
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
@@ -18350,6 +18374,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@Test
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@Test
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
@@ -25,6 +25,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@@ -17744,6 +17750,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@Test
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@Test
@TestMetadata("classLiteralOnInlineClass.kt")
public void testClassLiteralOnInlineClass() throws Exception {
@@ -17972,6 +17984,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@Test
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@Test
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
@@ -17984,6 +18002,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt");
}
@Test
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@Test
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
@@ -18374,6 +18398,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@Test
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@Test
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
@@ -30,6 +30,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true, "ranges/stepped", "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -14727,6 +14732,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("classLiteralOnInlineClass.kt")
public void testClassLiteralOnInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt");
@@ -14912,6 +14922,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
@@ -14922,6 +14937,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -15212,6 +15232,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/kt45084.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -12861,6 +12866,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -13041,11 +13051,21 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -13311,6 +13331,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true, "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -12267,6 +12272,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -12447,11 +12457,21 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -12717,6 +12737,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true, "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -12332,6 +12337,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -12512,11 +12522,21 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -12782,6 +12802,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
@@ -30,6 +30,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true, "toArray", "classLiteral", "reflection", "contracts", "platformTypes", "ranges/stepped/unsigned", "coroutines", "parametersMetadata", "finally", "deadCodeElimination", "controlStructures/tryCatchInExpressions", "delegatedProperty", "compileKotlinAgainstKotlin");
}
@TestMetadata("boxImplDoesNotExecuteInSecondaryConstructor.kt")
public void testBoxImplDoesNotExecuteInSecondaryConstructor() throws Exception {
runTest("compiler/testData/codegen/box/boxImplDoesNotExecuteInSecondaryConstructor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -6552,6 +6557,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt");
}
@TestMetadata("classInInlineClassInit.kt")
public void testClassInInlineClassInit() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt");
}
@TestMetadata("computablePropertyInsideInlineClass.kt")
public void testComputablePropertyInsideInlineClass() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt");
@@ -6697,11 +6707,21 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt");
}
@TestMetadata("inlineClassFieldHandling.kt")
public void testInlineClassFieldHandling() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt");
}
@TestMetadata("inlineClassFunctionInvoke.kt")
public void testInlineClassFunctionInvoke() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt");
}
@TestMetadata("inlineClassInInitBlock.kt")
public void testInlineClassInInitBlock() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt");
}
@TestMetadata("inlineClassInStringTemplate.kt")
public void testInlineClassInStringTemplate() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt");
@@ -6932,6 +6952,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
}
@TestMetadata("kt46554.kt")
public void testKt46554() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt46554.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");