diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InlineClassDeclarationLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InlineClassDeclarationLowering.kt index f5632b8194f..b341fbb0c47 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InlineClassDeclarationLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InlineClassDeclarationLowering.kt @@ -156,6 +156,8 @@ class InlineClassLowering(val context: CommonBackendContext) { +statement.transformStatement(object : IrElementTransformerVoid() { override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall): IrExpression { expression.transformChildrenVoid() + // Static function for delegating constructors return unboxed instance of inline class + expression.type = irClass.defaultType return irBlock(expression) { thisVar = createTmpVariable( expression, diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/AutoboxingTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/AutoboxingTransformer.kt index 86914f662a9..1c3b6d529db 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/AutoboxingTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/AutoboxingTransformer.kt @@ -7,13 +7,11 @@ package org.jetbrains.kotlin.ir.backend.js.lower import org.jetbrains.kotlin.backend.common.BodyLoweringPass import org.jetbrains.kotlin.backend.common.lower.AbstractValueUsageTransformer +import org.jetbrains.kotlin.ir.IrBuiltIns import org.jetbrains.kotlin.ir.backend.js.JsCommonBackendContext import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget -import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent -import org.jetbrains.kotlin.ir.declarations.IrFunction -import org.jetbrains.kotlin.ir.declarations.IrValueParameter +import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.isPrimitiveArray @@ -126,7 +124,7 @@ class AutoboxingTransformer(context: JsCommonBackendContext) : AbstractValueUsag if (actualType.isUnit() && !expectedType.isUnit()) { // Don't materialize Unit if value is known to be proper Unit on runtime - if (!this.isGetUnit()) { + if (!this.isGetUnit(irBuiltIns)) { val unitValue = JsIrBuilder.buildGetObjectValue(actualType, context.irBuiltIns.unitClass) return JsIrBuilder.buildComposite(actualType, listOf(this, unitValue)) } @@ -160,20 +158,6 @@ class AutoboxingTransformer(context: JsCommonBackendContext) : AbstractValueUsag } } - private tailrec fun IrExpression.isGetUnit(): Boolean = - when (this) { - is IrContainerExpression -> - when (val lastStmt = this.statements.lastOrNull()) { - is IrExpression -> lastStmt.isGetUnit() - else -> false - } - - is IrGetObjectValue -> - this.symbol == irBuiltIns.unitClass - - else -> false - } - private fun buildSafeCall( arg: IrExpression, actualType: IrType, @@ -206,4 +190,33 @@ class AutoboxingTransformer(context: JsCommonBackendContext) : AbstractValueUsag ) } } -} \ No newline at end of file +} + +class UnitMaterializationPass(val context: JsCommonBackendContext) : AbstractValueUsageTransformer(context.irBuiltIns), BodyLoweringPass { + override fun lower(irBody: IrBody, container: IrDeclaration) { + irBody.transformChildrenVoid() + } + + override fun IrExpression.useAsValue(value: IrValueDeclaration): IrExpression { + if (this.type == irBuiltIns.unitType && !this.isGetUnit(irBuiltIns)) { + val unitValue = JsIrBuilder.buildGetObjectValue(type, irBuiltIns.unitClass) + return JsIrBuilder.buildComposite(type, listOf(this, unitValue)) + } + return this + } +} + + +private tailrec fun IrExpression.isGetUnit(irBuiltIns: IrBuiltIns): Boolean = + when (this) { + is IrContainerExpression -> + when (val lastStmt = this.statements.lastOrNull()) { + is IrExpression -> lastStmt.isGetUnit(irBuiltIns) + else -> false + } + + is IrGetObjectValue -> + this.symbol == irBuiltIns.unitClass + + else -> false + } \ No newline at end of file diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt index 56562b20c26..737e6e4890a 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.backend.common.ir.isMethodOfAny import org.jetbrains.kotlin.backend.common.ir.isTopLevel import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET +import org.jetbrains.kotlin.ir.backend.js.JsCommonBackendContext import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin import org.jetbrains.kotlin.ir.backend.js.export.isExported @@ -115,6 +116,9 @@ fun IrBody.prependFunctionCall( } } +fun JsCommonBackendContext.findUnitGetInstanceFunction(): IrSimpleFunction = + mapping.objectToGetInstanceFunction[irBuiltIns.unitClass.owner]!! + fun IrDeclaration.isImportedFromModuleOnly(): Boolean { return isTopLevel && isEffectivelyExternal() && (getJsModule() != null && !isJsNonModule() || (parent as? IrAnnotationContainer)?.getJsModule() != null) } diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt index eb46d02bbe0..aca65b5a512 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt @@ -328,6 +328,12 @@ private val wasmNullSpecializationLowering = makeWasmModulePhase( description = "Specialize assigning Nothing? values to other types." ) +private val unitMaterializationPass = makeWasmModulePhase( + { context -> UnitMaterializationPass(context) }, + name = "UnitLoweringPass", + description = "Materialize unit instances" +) + private val staticMembersLoweringPhase = makeWasmModulePhase( ::StaticMembersLowering, name = "StaticMembersLowering", @@ -499,5 +505,6 @@ val wasmPhases = NamedCompilerPhase( wasmThrowDebugLoweringPhase then staticMembersLoweringPhase then wasmNullSpecializationLowering then + unitMaterializationPass then validateIrAfterLowering ) diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/BodyGenerator.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/BodyGenerator.kt index 003f23c6576..54215ed8d00 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/BodyGenerator.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/BodyGenerator.kt @@ -20,10 +20,7 @@ import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.types.* -import org.jetbrains.kotlin.ir.util.defaultType -import org.jetbrains.kotlin.ir.util.getInlineClassBackingField -import org.jetbrains.kotlin.ir.util.isInterface -import org.jetbrains.kotlin.ir.util.parentAsClass +import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid import org.jetbrains.kotlin.ir.visitors.acceptVoid import org.jetbrains.kotlin.wasm.ir.* @@ -40,6 +37,13 @@ class BodyGenerator(val context: WasmFunctionCodegenContext) : IrElementVisitorV error("Unexpected element of type ${element::class}") } + val unitGetInstance by lazy { backendContext.mapping.objectToGetInstanceFunction[irBuiltIns.unitClass.owner]!! } + + override fun visitGetObjectValue(expression: IrGetObjectValue) { + require(expression.symbol == irBuiltIns.unitClass) + body.buildCall(context.referenceFunction(unitGetInstance.symbol)) + } + override fun visitTypeOperator(expression: IrTypeOperatorCall) { require(expression.operator == IrTypeOperator.REINTERPRET_CAST) { "Other types of casts must be lowered" } generateExpression(expression.argument) @@ -329,11 +333,7 @@ class BodyGenerator(val context: WasmFunctionCodegenContext) : IrElementVisitorV statementToWasmInstruction(it) } - if (expression.type != irBuiltIns.unitType) { - generateExpression(statements.last() as IrExpression) - } else { - statementToWasmInstruction(statements.last()) - } + generateExpression(statements.last() as IrExpression) } override fun visitBreak(jump: IrBreak) { @@ -345,18 +345,17 @@ class BodyGenerator(val context: WasmFunctionCodegenContext) : IrElementVisitorV } override fun visitReturn(expression: IrReturn) { - generateExpression(expression.value) - - // FIXME: Hack for "returning" Unit from functions with generic return type. - // Common case -- lambdas returning unit. - if (expression.value.type == irBuiltIns.unitType && - expression.returnTargetSymbol.owner.returnType(backendContext) != irBuiltIns.unitType + if ( + expression.value.type == irBuiltIns.unitType && + expression.returnTargetSymbol.owner.returnType(backendContext) == irBuiltIns.unitType ) { - val irReturnType = expression.returnTargetSymbol.owner.returnType(backendContext) + statementToWasmInstruction(expression.value) + } else { + generateExpression(expression.value) + } - if (irReturnType != irBuiltIns.unitType) { - generateDefaultInitializerForType(context.transformType(irReturnType), body) - } + if (context.irFunction is IrConstructor) { + body.buildGetLocal(context.referenceLocal(0)) } // Handle complex exported parameters. @@ -371,25 +370,6 @@ class BodyGenerator(val context: WasmFunctionCodegenContext) : IrElementVisitorV } override fun visitWhen(expression: IrWhen) { - if (expression.type == irBuiltIns.unitType) { - var ifCount = 0 - for (branch in expression.branches) { - if (!isElseBranch(branch)) { - generateExpression(branch.condition) - body.buildIf(label = null, resultType = null) - statementToWasmInstruction(branch.result) - body.buildElse() - ifCount++ - } else { - statementToWasmInstruction(branch.result) - break - } - } - - repeat(ifCount) { body.buildEnd() } - return - } - val resultType = context.transformBlockResultType(expression.type) var ifCount = 0 for (branch in expression.branches) { @@ -489,10 +469,47 @@ class BodyGenerator(val context: WasmFunctionCodegenContext) : IrElementVisitorV return } - generateExpression(statement as IrExpression) + if (statement is IrContainerExpression) { + statement.statements.forEach { it -> + statementToWasmInstruction(it) + } + } else if (statement is IrWhen) { + var ifCount = 0 + for (branch in statement.branches) { + if (!isElseBranch(branch)) { + generateExpression(branch.condition) + body.buildIf(label = null, resultType = null) + statementToWasmInstruction(branch.result) + body.buildElse() + ifCount++ + } else { + statementToWasmInstruction(branch.result) + break + } + } - if (statement.type != irBuiltIns.unitType && statement.type != irBuiltIns.nothingType) { - body.buildInstr(WasmOp.DROP) + repeat(ifCount) { body.buildEnd() } + } else { + generateExpression(statement as IrExpression) + + var needDrop = true + if (statement.type == irBuiltIns.nothingType) + needDrop = false + + if (statement is IrSetValue || statement is IrBreakContinue || statement is IrSetField || statement is IrLoop || statement is IrDelegatingConstructorCall) { + needDrop = false + } + + if (statement is IrCall || statement is IrConstructorCall) { + val unitGetInstanceCall = statement is IrCall && statement.symbol.owner == unitGetInstance + if (statement.type == irBuiltIns.unitType && !unitGetInstanceCall) { + needDrop = false + } + } + + if (needDrop) { + body.buildInstr(WasmOp.DROP) + } } } diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/DeclarationGenerator.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/DeclarationGenerator.kt index 932e2135f23..5239e97e648 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/DeclarationGenerator.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/DeclarationGenerator.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.ir.IrBuiltIns import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.backend.js.utils.findUnitGetInstanceFunction import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrBlockBody @@ -29,6 +30,8 @@ class DeclarationGenerator(val context: WasmModuleCodegenContext) : IrElementVis private val backendContext: WasmBackendContext = context.backendContext private val irBuiltIns: IrBuiltIns = backendContext.irBuiltIns + private val unitGetInstanceFunction: IrSimpleFunction by lazy { backendContext.findUnitGetInstanceFunction() } + override fun visitElement(element: IrElement) { error("Unexpected element of type ${element::class}") } @@ -84,8 +87,18 @@ class DeclarationGenerator(val context: WasmModuleCodegenContext) : IrElementVis } }, resultTypes = listOfNotNull( - resultType.let { - if (importedName != null && it is WasmRefNullType) WasmEqRef else it + run { + val type = if (declaration == unitGetInstanceFunction) { + // Unit_getInstance returns true Unit reference instead of "void" + context.transformType(declaration.returnType) + } else { + resultType + } + + if (importedName != null && type is WasmRefNullType) + WasmEqRef + else + type } ) ) diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmTypeOperatorLowering.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmTypeOperatorLowering.kt index 958906951a7..afc7599f41b 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmTypeOperatorLowering.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmTypeOperatorLowering.kt @@ -14,9 +14,12 @@ import org.jetbrains.kotlin.backend.common.lower.createIrBuilder import org.jetbrains.kotlin.backend.common.lower.irNot import org.jetbrains.kotlin.backend.wasm.WasmBackendContext import org.jetbrains.kotlin.backend.wasm.ir2wasm.erasedUpperBound +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.backend.js.utils.findUnitGetInstanceFunction import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.declarations.IrTypeParameter +import org.jetbrains.kotlin.ir.declarations.IrVariable import org.jetbrains.kotlin.ir.expressions.IrConst import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrTypeOperator @@ -35,6 +38,7 @@ class WasmTypeOperatorLowering(val context: WasmBackendContext) : FileLoweringPa class WasmBaseTypeOperatorTransformer(val context: WasmBackendContext) : IrElementTransformerVoidWithContext() { private val symbols = context.wasmSymbols private val builtIns = context.irBuiltIns + private val unitGetInstance = context.findUnitGetInstanceFunction() private lateinit var builder: DeclarationIrBuilder @@ -45,7 +49,7 @@ class WasmBaseTypeOperatorTransformer(val context: WasmBackendContext) : IrEleme return when (expression.operator) { IrTypeOperator.IMPLICIT_CAST -> lowerImplicitCast(expression) IrTypeOperator.IMPLICIT_DYNAMIC_CAST -> error("Dynamic casts are not supported in Wasm backend") - IrTypeOperator.IMPLICIT_COERCION_TO_UNIT -> expression.argument + IrTypeOperator.IMPLICIT_COERCION_TO_UNIT -> builder.irComposite(resultType = builtIns.unitType) { +expression.argument } IrTypeOperator.IMPLICIT_INTEGER_COERCION -> lowerIntegerCoercion(expression) IrTypeOperator.IMPLICIT_NOTNULL -> lowerImplicitCast(expression) IrTypeOperator.INSTANCEOF -> lowerInstanceOf(expression, inverted = false) @@ -57,6 +61,19 @@ class WasmBaseTypeOperatorTransformer(val context: WasmBackendContext) : IrEleme } } + override fun visitVariable(declaration: IrVariable): IrStatement { + // Some IR passes, notable for-loops-lowering assumes implicit cast during variable initialization + val initializer = declaration.initializer + if (initializer != null && + initializer.type != declaration.type + ) { + builder = context.createIrBuilder(currentScope!!.scope.scopeOwnerSymbol).at(declaration) + declaration.initializer = narrowType(initializer.type, declaration.type, initializer) + } + + return super.visitVariable(declaration) + } + private fun lowerInstanceOf( expression: IrTypeOperatorCall, inverted: Boolean @@ -135,10 +152,7 @@ class WasmBaseTypeOperatorTransformer(val context: WasmBackendContext) : IrEleme private fun generateTypeCheckNonNull(argument: IrExpression, toType: IrType): IrExpression { assert(!toType.isMarkedNullable()) return when { - toType.isNothing() -> builder.irComposite(resultType = builtIns.booleanType) { - +(argument) - +builder.irFalse() - } + toType.isNothing() -> builder.irFalse() toType.isTypeParameter() -> generateTypeCheckWithTypeParameter(argument, toType) toType.isInterface() -> generateIsInterface(argument, toType) else -> generateIsSubClass(argument, toType) @@ -281,16 +295,10 @@ class WasmBaseTypeOperatorTransformer(val context: WasmBackendContext) : IrEleme val fromTypeErased = fromType.erasedType val toTypeErased = toType.erasedType if (fromTypeErased.isSubtypeOfClass(toTypeErased.classOrNull!!)) { - return builder.irComposite { - +argument - +builder.irTrue() - } + return builder.irTrue() } if (!toTypeErased.isSubtypeOfClass(fromTypeErased.classOrNull!!)) { - return builder.irComposite { - +argument - +builder.irFalse() - } + return builder.irFalse() } return builder.irCall(symbols.refTest).apply { diff --git a/compiler/testData/codegen/box/arrays/forInReversed/reversedOriginalUpdatedInLoopBody.kt b/compiler/testData/codegen/box/arrays/forInReversed/reversedOriginalUpdatedInLoopBody.kt index 1f05e3ab4ea..6d92e42b8ef 100644 --- a/compiler/testData/codegen/box/arrays/forInReversed/reversedOriginalUpdatedInLoopBody.kt +++ b/compiler/testData/codegen/box/arrays/forInReversed/reversedOriginalUpdatedInLoopBody.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: STDLIB_COLLECTIONS // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/arrays/forInReversed/reversedReversedOriginalUpdatedInLoopBody.kt b/compiler/testData/codegen/box/arrays/forInReversed/reversedReversedOriginalUpdatedInLoopBody.kt index 902716d3587..3aaefffebeb 100644 --- a/compiler/testData/codegen/box/arrays/forInReversed/reversedReversedOriginalUpdatedInLoopBody.kt +++ b/compiler/testData/codegen/box/arrays/forInReversed/reversedReversedOriginalUpdatedInLoopBody.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: STDLIB_COLLECTIONS // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/arrays/kt594.kt b/compiler/testData/codegen/box/arrays/kt594.kt index c12fd898ddb..c67bd1b66e7 100644 --- a/compiler/testData/codegen/box/arrays/kt594.kt +++ b/compiler/testData/codegen/box/arrays/kt594.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES package array_test fun box() : String { diff --git a/compiler/testData/codegen/box/arrays/nonLocalReturnArrayConstructor.kt b/compiler/testData/codegen/box/arrays/nonLocalReturnArrayConstructor.kt index d981f577025..beb703224b1 100644 --- a/compiler/testData/codegen/box/arrays/nonLocalReturnArrayConstructor.kt +++ b/compiler/testData/codegen/box/arrays/nonLocalReturnArrayConstructor.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: INLINE_ARRAY_CONSTRUCTOR typealias ArrayS = Array fun testArray() { diff --git a/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt index ce8633c0da6..e7660d91d8c 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt index c62cfa89120..0e951a011e7 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/unitAsAny.kt b/compiler/testData/codegen/box/casts/unitAsAny.kt index 7f378b05701..74326356cba 100644 --- a/compiler/testData/codegen/box/casts/unitAsAny.kt +++ b/compiler/testData/codegen/box/casts/unitAsAny.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun println(s: String) { } diff --git a/compiler/testData/codegen/box/casts/unitAsSafeAny.kt b/compiler/testData/codegen/box/casts/unitAsSafeAny.kt index c79dc43079e..81d5a495425 100644 --- a/compiler/testData/codegen/box/casts/unitAsSafeAny.kt +++ b/compiler/testData/codegen/box/casts/unitAsSafeAny.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun println(s: String) { } diff --git a/compiler/testData/codegen/box/casts/unitNullableCast.kt b/compiler/testData/codegen/box/casts/unitNullableCast.kt index 6e8f51599d5..c0f644e88a5 100644 --- a/compiler/testData/codegen/box/casts/unitNullableCast.kt +++ b/compiler/testData/codegen/box/casts/unitNullableCast.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun foo() {} fun bar(): Int? = foo() as? Int diff --git a/compiler/testData/codegen/box/classes/kt1918.kt b/compiler/testData/codegen/box/classes/kt1918.kt index 7cb847544c6..1da1471e2d3 100644 --- a/compiler/testData/codegen/box/classes/kt1918.kt +++ b/compiler/testData/codegen/box/classes/kt1918.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES class Bar { } diff --git a/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt b/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt index 235ab4d83cd..7eb57014a10 100644 --- a/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt +++ b/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: STDLIB_COLLECTIONS // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME class ArrayWrapper() { diff --git a/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutinesNoStdLib.kt b/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutinesNoStdLib.kt index 0a01d53ca1d..33eb6b91504 100644 --- a/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutinesNoStdLib.kt +++ b/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutinesNoStdLib.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: COROUTINES // WITH_RUNTIME // WITH_COROUTINES import helpers.* diff --git a/compiler/testData/codegen/box/controlStructures/kt2597.kt b/compiler/testData/codegen/box/controlStructures/kt2597.kt index 94da5db09b4..af5af144a86 100644 --- a/compiler/testData/codegen/box/controlStructures/kt2597.kt +++ b/compiler/testData/codegen/box/controlStructures/kt2597.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun box(): String { var i = 0 { diff --git a/compiler/testData/codegen/box/dataClasses/toString/unitComponent.kt b/compiler/testData/codegen/box/dataClasses/toString/unitComponent.kt index b3a699a9cba..72e5965b320 100644 --- a/compiler/testData/codegen/box/dataClasses/toString/unitComponent.kt +++ b/compiler/testData/codegen/box/dataClasses/toString/unitComponent.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES data class A(val x: Unit) fun box(): String { diff --git a/compiler/testData/codegen/box/dataClasses/unitComponent.kt b/compiler/testData/codegen/box/dataClasses/unitComponent.kt index ad6967dcc9b..b70b461ab91 100644 --- a/compiler/testData/codegen/box/dataClasses/unitComponent.kt +++ b/compiler/testData/codegen/box/dataClasses/unitComponent.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES data class A(val x: Unit) fun box(): String { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt index 93044f70066..4655ecc7a61 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES // DONT_RUN_GENERATED_CODE: JS tailrec fun foo(x: Int) { diff --git a/compiler/testData/codegen/box/functions/kt1649_2.kt b/compiler/testData/codegen/box/functions/kt1649_2.kt index 5b975d07037..33f420dc3f9 100644 --- a/compiler/testData/codegen/box/functions/kt1649_2.kt +++ b/compiler/testData/codegen/box/functions/kt1649_2.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES interface A { val method : () -> Unit? } diff --git a/compiler/testData/codegen/box/functions/kt3214.kt b/compiler/testData/codegen/box/functions/kt3214.kt index 4b97a069420..8ff33fcad23 100644 --- a/compiler/testData/codegen/box/functions/kt3214.kt +++ b/compiler/testData/codegen/box/functions/kt3214.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES class A { fun get(vararg x: Int) = x.size } diff --git a/compiler/testData/codegen/box/functions/localFunctions/localExtensionOnNullableParameter.kt b/compiler/testData/codegen/box/functions/localFunctions/localExtensionOnNullableParameter.kt index 4ce1d05f3ad..709b1c9ac1e 100644 --- a/compiler/testData/codegen/box/functions/localFunctions/localExtensionOnNullableParameter.kt +++ b/compiler/testData/codegen/box/functions/localFunctions/localExtensionOnNullableParameter.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES open class T(var value: Int) {} fun localExtensionOnNullableParameter(): T { diff --git a/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt b/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt index aeda825f1d7..11590ac5d57 100644 --- a/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt +++ b/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun myRun(action: () -> T): T = action() fun foo(): String = "foo" diff --git a/compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt b/compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt index 52cfa132800..bcec7175e23 100644 --- a/compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt +++ b/compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES class Inv(val x: T?) diff --git a/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt b/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt index 1cd35abfbd7..df21fa88cf8 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES // !LANGUAGE: +InlineClasses inline class UInt(private val value: Int) { diff --git a/compiler/testData/codegen/box/ir/kt25405.kt b/compiler/testData/codegen/box/ir/kt25405.kt index 4a4cf08c3d9..485922deed7 100644 --- a/compiler/testData/codegen/box/ir/kt25405.kt +++ b/compiler/testData/codegen/box/ir/kt25405.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun tableView(init: Table.() -> Unit) { Table().init() } diff --git a/compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexReversed.kt b/compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexReversed.kt index b626a8f73c1..4bf5be9abbc 100644 --- a/compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexReversed.kt +++ b/compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexReversed.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: STDLIB_COLLECTIONS // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/regressions/kt5953.kt b/compiler/testData/codegen/box/regressions/kt5953.kt index 63d15a2f3cc..3f41c4efa75 100644 --- a/compiler/testData/codegen/box/regressions/kt5953.kt +++ b/compiler/testData/codegen/box/regressions/kt5953.kt @@ -1,5 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES +// WASM_MUTE_REASON: STDLIB_COLLECTIONS // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/secondaryConstructors/withNonLocalReturn.kt b/compiler/testData/codegen/box/secondaryConstructors/withNonLocalReturn.kt index 0079a2dade7..4ab9a4450b1 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/withNonLocalReturn.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/withNonLocalReturn.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES inline fun run2(block: () -> Unit) = block() class A { diff --git a/compiler/testData/codegen/box/secondaryConstructors/withReturn.kt b/compiler/testData/codegen/box/secondaryConstructors/withReturn.kt index 3ce661208cf..b6cb18cf2af 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/withReturn.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/withReturn.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES class A { val prop: Int constructor(arg: Boolean) { diff --git a/compiler/testData/codegen/box/secondaryConstructors/withReturnUnit.kt b/compiler/testData/codegen/box/secondaryConstructors/withReturnUnit.kt index b8785eef427..956c6db367e 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/withReturnUnit.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/withReturnUnit.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES class A { val prop: Int constructor(arg: Boolean) { diff --git a/compiler/testData/codegen/box/unit/UnitValue.kt b/compiler/testData/codegen/box/unit/UnitValue.kt index a13c0e6e54b..243b563dba8 100644 --- a/compiler/testData/codegen/box/unit/UnitValue.kt +++ b/compiler/testData/codegen/box/unit/UnitValue.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun foo() {} fun box(): String { diff --git a/compiler/testData/codegen/box/unit/closureReturnsNullableUnit.kt b/compiler/testData/codegen/box/unit/closureReturnsNullableUnit.kt index ec1d4db35f3..604b35ab71f 100644 --- a/compiler/testData/codegen/box/unit/closureReturnsNullableUnit.kt +++ b/compiler/testData/codegen/box/unit/closureReturnsNullableUnit.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun isNull(x: Unit?) = x == null fun box(): String { diff --git a/compiler/testData/codegen/box/unit/kt3634.kt b/compiler/testData/codegen/box/unit/kt3634.kt index 41b355ce56a..4dcbf3f5bfe 100644 --- a/compiler/testData/codegen/box/unit/kt3634.kt +++ b/compiler/testData/codegen/box/unit/kt3634.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES val c = Unit val d = c diff --git a/compiler/testData/codegen/box/unit/kt4212.kt b/compiler/testData/codegen/box/unit/kt4212.kt index f90e272af85..5d9db4097e7 100644 --- a/compiler/testData/codegen/box/unit/kt4212.kt +++ b/compiler/testData/codegen/box/unit/kt4212.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun foo(): Any? = bar() fun bar() {} diff --git a/compiler/testData/codegen/box/unit/kt4265.kt b/compiler/testData/codegen/box/unit/kt4265.kt index ccde5f60ef7..3c1aaf9d462 100644 --- a/compiler/testData/codegen/box/unit/kt4265.kt +++ b/compiler/testData/codegen/box/unit/kt4265.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun T.let(f: (T) -> R): R = f(this) fun box(): String { diff --git a/compiler/testData/codegen/box/unit/nullableUnit.kt b/compiler/testData/codegen/box/unit/nullableUnit.kt index c9d1772bc5a..0289cca09ba 100644 --- a/compiler/testData/codegen/box/unit/nullableUnit.kt +++ b/compiler/testData/codegen/box/unit/nullableUnit.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun isNull(x: Unit?) = x == null fun isNullGeneric(x: T?) = x == null diff --git a/compiler/testData/codegen/box/unit/nullableUnitInWhen3.kt b/compiler/testData/codegen/box/unit/nullableUnitInWhen3.kt index dec7f2b7a1f..b2e2b0ae439 100644 --- a/compiler/testData/codegen/box/unit/nullableUnitInWhen3.kt +++ b/compiler/testData/codegen/box/unit/nullableUnitInWhen3.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun foo() {} fun box(): String { diff --git a/compiler/testData/codegen/box/unit/unitClassObject.kt b/compiler/testData/codegen/box/unit/unitClassObject.kt index 6d29747589a..e4cdbacbe14 100644 --- a/compiler/testData/codegen/box/unit/unitClassObject.kt +++ b/compiler/testData/codegen/box/unit/unitClassObject.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES fun box(): String { Unit diff --git a/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt b/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt index 12e50f90e8e..2c69069abac 100644 --- a/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt +++ b/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt @@ -1,5 +1,3 @@ -// DONT_TARGET_EXACT_BACKEND: WASM -// WASM_MUTE_REASON: UNIT_ISSUES enum class En { A, B diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index f82b1e8bd13..739cbe64619 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -458,6 +458,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/arrays/kt4357.kt"); } + @TestMetadata("kt594.kt") + public void testKt594() throws Exception { + runTest("compiler/testData/codegen/box/arrays/kt594.kt"); + } + @TestMetadata("kt7009.kt") public void testKt7009() throws Exception { runTest("compiler/testData/codegen/box/arrays/kt7009.kt"); @@ -1971,6 +1976,21 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/casts/objectToPrimitiveWithAssertion.kt"); } + @TestMetadata("unitAsAny.kt") + public void testUnitAsAny() throws Exception { + runTest("compiler/testData/codegen/box/casts/unitAsAny.kt"); + } + + @TestMetadata("unitAsSafeAny.kt") + public void testUnitAsSafeAny() throws Exception { + runTest("compiler/testData/codegen/box/casts/unitAsSafeAny.kt"); + } + + @TestMetadata("unitNullableCast.kt") + public void testUnitNullableCast() throws Exception { + runTest("compiler/testData/codegen/box/casts/unitNullableCast.kt"); + } + @TestMetadata("compiler/testData/codegen/box/casts/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -2284,6 +2304,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/classes/kt1891.kt"); } + @TestMetadata("kt1918.kt") + public void testKt1918() throws Exception { + runTest("compiler/testData/codegen/box/classes/kt1918.kt"); + } + @TestMetadata("kt1976.kt") public void testKt1976() throws Exception { runTest("compiler/testData/codegen/box/classes/kt1976.kt"); @@ -3436,6 +3461,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/controlStructures/kt2416.kt"); } + @TestMetadata("kt2597.kt") + public void testKt2597() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/kt2597.kt"); + } + @TestMetadata("kt299.kt") public void testKt299() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/kt299.kt"); @@ -3840,6 +3870,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/dataClasses/twoVarParams.kt"); } + @TestMetadata("unitComponent.kt") + public void testUnitComponent() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); + } + @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -4035,6 +4070,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest public void testMixedParams() throws Exception { runTest("compiler/testData/codegen/box/dataClasses/toString/mixedParams.kt"); } + + @TestMetadata("unitComponent.kt") + public void testUnitComponent() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/toString/unitComponent.kt"); + } } } @@ -4780,6 +4820,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/sum.kt"); } + @TestMetadata("tailCallInBlockInParentheses.kt") + public void testTailCallInBlockInParentheses() throws Exception { + runTest("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt"); + } + @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses() throws Exception { runTest("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInParentheses.kt"); @@ -5809,6 +5854,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/functions/kt1649_1.kt"); } + @TestMetadata("kt1649_2.kt") + public void testKt1649_2() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt1649_2.kt"); + } + @TestMetadata("kt2270.kt") public void testKt2270() throws Exception { runTest("compiler/testData/codegen/box/functions/kt2270.kt"); @@ -5844,6 +5894,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/functions/kt2929.kt"); } + @TestMetadata("kt3214.kt") + public void testKt3214() throws Exception { + runTest("compiler/testData/codegen/box/functions/kt3214.kt"); + } + @TestMetadata("kt3313.kt") public void testKt3313() throws Exception { runTest("compiler/testData/codegen/box/functions/kt3313.kt"); @@ -6155,6 +6210,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/functions/localFunctions/kt4989.kt"); } + @TestMetadata("localExtensionOnNullableParameter.kt") + public void testLocalExtensionOnNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/localExtensionOnNullableParameter.kt"); + } + @TestMetadata("localFunctionInConstructor.kt") public void testLocalFunctionInConstructor() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/localFunctionInConstructor.kt"); @@ -6578,6 +6638,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/inference/capturedTypesSubstitutionIntoAbbreviation.kt"); } + @TestMetadata("coercionToUnitWithLastLambdaExpression.kt") + public void testCoercionToUnitWithLastLambdaExpression() throws Exception { + runTest("compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt"); + } + @TestMetadata("earlyReturnInsideCrossinlineLambda.kt") public void testEarlyReturnInsideCrossinlineLambda() throws Exception { runTest("compiler/testData/codegen/box/inference/earlyReturnInsideCrossinlineLambda.kt"); @@ -6633,6 +6698,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt"); } + @TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt") + public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception { + runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt"); + } + @TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt") public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception { runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt"); @@ -6792,6 +6862,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt"); } + @TestMetadata("boxUnboxOfInlineClassForCapturedVars.kt") + public void testBoxUnboxOfInlineClassForCapturedVars() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt"); + } + @TestMetadata("bridgeForFunctionReturningInlineClass.kt") public void testBridgeForFunctionReturningInlineClass() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt"); @@ -9076,6 +9151,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ir/hashCodeOnGenericSubstitutedWithPrimitive.kt"); } + @TestMetadata("kt25405.kt") + public void testKt25405() throws Exception { + runTest("compiler/testData/codegen/box/ir/kt25405.kt"); + } + @TestMetadata("kt40083.kt") public void testKt40083() throws Exception { runTest("compiler/testData/codegen/box/ir/kt40083.kt"); @@ -14626,6 +14706,21 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/secondaryConstructors/varargs.kt"); } + @TestMetadata("withNonLocalReturn.kt") + public void testWithNonLocalReturn() throws Exception { + runTest("compiler/testData/codegen/box/secondaryConstructors/withNonLocalReturn.kt"); + } + + @TestMetadata("withReturn.kt") + public void testWithReturn() throws Exception { + runTest("compiler/testData/codegen/box/secondaryConstructors/withReturn.kt"); + } + + @TestMetadata("withReturnUnit.kt") + public void testWithReturnUnit() throws Exception { + runTest("compiler/testData/codegen/box/secondaryConstructors/withReturnUnit.kt"); + } + @TestMetadata("withoutPrimarySimple.kt") public void testWithoutPrimarySimple() throws Exception { runTest("compiler/testData/codegen/box/secondaryConstructors/withoutPrimarySimple.kt"); @@ -15955,11 +16050,36 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/unit"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("closureReturnsNullableUnit.kt") + public void testClosureReturnsNullableUnit() throws Exception { + runTest("compiler/testData/codegen/box/unit/closureReturnsNullableUnit.kt"); + } + @TestMetadata("ifElse.kt") public void testIfElse() throws Exception { runTest("compiler/testData/codegen/box/unit/ifElse.kt"); } + @TestMetadata("kt3634.kt") + public void testKt3634() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt3634.kt"); + } + + @TestMetadata("kt4212.kt") + public void testKt4212() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt4212.kt"); + } + + @TestMetadata("kt4265.kt") + public void testKt4265() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt4265.kt"); + } + + @TestMetadata("nullableUnit.kt") + public void testNullableUnit() throws Exception { + runTest("compiler/testData/codegen/box/unit/nullableUnit.kt"); + } + @TestMetadata("nullableUnitInWhen1.kt") public void testNullableUnitInWhen1() throws Exception { runTest("compiler/testData/codegen/box/unit/nullableUnitInWhen1.kt"); @@ -15969,6 +16089,21 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest public void testNullableUnitInWhen2() throws Exception { runTest("compiler/testData/codegen/box/unit/nullableUnitInWhen2.kt"); } + + @TestMetadata("nullableUnitInWhen3.kt") + public void testNullableUnitInWhen3() throws Exception { + runTest("compiler/testData/codegen/box/unit/nullableUnitInWhen3.kt"); + } + + @TestMetadata("unitClassObject.kt") + public void testUnitClassObject() throws Exception { + runTest("compiler/testData/codegen/box/unit/unitClassObject.kt"); + } + + @TestMetadata("UnitValue.kt") + public void testUnitValue() throws Exception { + runTest("compiler/testData/codegen/box/unit/UnitValue.kt"); + } } @TestMetadata("compiler/testData/codegen/box/unsignedTypes") @@ -16330,6 +16465,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/when/noElseExhaustiveStatement.kt"); } + @TestMetadata("noElseExhaustiveUnitExpected.kt") + public void testNoElseExhaustiveUnitExpected() throws Exception { + runTest("compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt"); + } + @TestMetadata("noElseInStatement.kt") public void testNoElseInStatement() throws Exception { runTest("compiler/testData/codegen/box/when/noElseInStatement.kt");