diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SingleAbstractMethodLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SingleAbstractMethodLowering.kt index 9fc26ba2b40..050e0b9b05d 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SingleAbstractMethodLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SingleAbstractMethodLowering.kt @@ -223,11 +223,15 @@ abstract class SingleAbstractMethodLowering(val context: CommonBackendContext) : extensionReceiverParameter = superMethod.extensionReceiverParameter?.copyTo(this) valueParameters = superMethod.valueParameters.map { it.copyTo(this) } body = context.createIrBuilder(symbol).irBlockBody { - +irReturn(irCall(wrappedFunctionClass.functions.single { it.name == OperatorNameConventions.INVOKE }).apply { - dispatchReceiver = irGetField(irGet(dispatchReceiverParameter!!), field) - extensionReceiverParameter?.let { putValueArgument(0, irGet(it)) } - valueParameters.forEachIndexed { i, parameter -> putValueArgument(extensionReceiversCount + i, irGet(parameter)) } - }) + +irReturn( + irCall( + wrappedFunctionClass.functions.single { it.name == OperatorNameConventions.INVOKE }.symbol, + superMethod.returnType + ).apply { + dispatchReceiver = irGetField(irGet(dispatchReceiverParameter!!), field) + extensionReceiverParameter?.let { putValueArgument(0, irGet(it)) } + valueParameters.forEachIndexed { i, parameter -> putValueArgument(extensionReceiversCount + i, irGet(parameter)) } + }) } } @@ -318,7 +322,7 @@ class SamEqualsHashCodeMethodsGenerator( private fun generateHashCode(anyGenerator: MethodsFromAnyGeneratorForLowerings) { anyGenerator.createHashCodeMethodDeclaration().apply { - val hashCode = context.irBuiltIns.functionClass.owner.functions.single{ it.isHashCode() }.symbol + val hashCode = context.irBuiltIns.functionClass.owner.functions.single { it.isHashCode() }.symbol body = context.createIrBuilder(symbol).run { irExprBody( irCall(hashCode).also { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CallableReferenceLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CallableReferenceLowering.kt index 38667b7db1e..eb70d0bc605 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CallableReferenceLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CallableReferenceLowering.kt @@ -21,9 +21,7 @@ import org.jetbrains.kotlin.ir.builders.declarations.* import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* -import org.jetbrains.kotlin.ir.types.IrSimpleType -import org.jetbrains.kotlin.ir.types.IrTypeProjection -import org.jetbrains.kotlin.ir.types.classOrNull +import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid @@ -120,9 +118,20 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod private val superClass = if (isSuspendLambda) context.ir.symbols.coroutineImpl.owner.defaultType else context.irBuiltIns.anyType private var boundReceiverField: IrField? = null - private val superFunctionInterface = reference.type.classOrNull?.owner ?: error("Expected functional type") + private val referenceType = reference.type as IrSimpleType + + private val superFunctionInterface: IrClass = referenceType.classOrNull?.owner ?: error("Expected functional type") private val isKReference = superFunctionInterface.name.identifier[0] == 'K' + // If we implement KFunctionN we also need FunctionN + private val secondFunctionInterface: IrClass? = if (isKReference) { + val arity = referenceType.arguments.size - 1 + if (function.isSuspend) + context.ir.symbols.suspendFunctionN(arity).owner + else + context.ir.symbols.functionN(arity).owner + } else null + private fun StringBuilder.collectNamesForLambda(d: IrDeclarationWithName) { val parent = d.parent @@ -167,7 +176,7 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod origin = if (isKReference || !isLambda) FUNCTION_REFERENCE_IMPL else LAMBDA_IMPL name = makeContextDependentName() }.apply { - superTypes = listOf(superClass, reference.type) + superTypes = listOfNotNull(superClass, referenceType, secondFunctionInterface?.symbol?.typeWithArguments(referenceType.arguments)) // if (samSuperType == null) // superTypes += functionSuperClass.typeWith(parameterTypes) // if (irFunctionReference.isSuspend) superTypes += context.ir.symbols.suspendFunctionInterface.defaultType @@ -241,7 +250,14 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod isSuspend = superMethod.isSuspend isOperator = superMethod.isOperator }.apply { - overriddenSymbols = listOf(superMethod.symbol) + val secondSuperMethods: List? = + secondFunctionInterface?.declarations?.filterIsInstance() + val secondSuperMethod = secondSuperMethods?.single { it.name.asString() == "invoke" } + + overriddenSymbols = listOfNotNull( + superMethod.symbol, + secondSuperMethod?.symbol + ) dispatchReceiverParameter = buildReceiverParameter(this, clazz.origin, clazz.defaultType, startOffset, endOffset) if (isLambda) createLambdaInvokeMethod() else createFunctionReferenceInvokeMethod() @@ -391,7 +407,10 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod private fun createNameProperty(clazz: IrClass) { if (!isKReference) return - val superProperty = superFunctionInterface.declarations.filterIsInstance().single() + val superProperty = superFunctionInterface.declarations + .filterIsInstance() + .single { it.name == Name.identifier("name") } // In K/Wasm interfaces can have fake overridden properties from Any + val supperGetter = superProperty.getter ?: error("Expected getter for KFunction.name property") val nameProperty = clazz.addProperty() { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt index 7690183912b..b20136b9f8c 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt @@ -206,7 +206,7 @@ class InteropCallableReferenceLowering(val context: JsIrBackendContext) : BodyLo newDeclarations: MutableList ): IrBlockBody { val invokeFun = lambdaClass.declarations.filterIsInstance().single { it.name.asString() == "invoke" } - val superInvokeFun = invokeFun.overriddenSymbols.single { it.owner.isSuspend == invokeFun.isSuspend }.owner + val superInvokeFun = invokeFun.overriddenSymbols.first { it.owner.isSuspend == invokeFun.isSuspend }.owner val lambdaName = Name.identifier("${lambdaClass.name.asString()}\$lambda") val superClass = superInvokeFun.parentAsClass diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt index 500350fd7ee..8873e2df670 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.ir.backend.js.lower import org.jetbrains.kotlin.backend.common.BodyLoweringPass +import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.common.ScopeWithIr import org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering import org.jetbrains.kotlin.descriptors.DescriptorVisibilities @@ -22,7 +23,7 @@ import org.jetbrains.kotlin.ir.util.file import org.jetbrains.kotlin.ir.util.parentClassOrNull import org.jetbrains.kotlin.ir.util.render -class JsSingleAbstractMethodLowering(context: JsIrBackendContext) : SingleAbstractMethodLowering(context), BodyLoweringPass { +class JsSingleAbstractMethodLowering(context: CommonBackendContext) : SingleAbstractMethodLowering(context), BodyLoweringPass { override fun getWrapperVisibility(expression: IrTypeOperatorCall, scopes: List): DescriptorVisibility = DescriptorVisibilities.LOCAL 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 bb4b83f22d9..d885d65986e 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 @@ -186,11 +186,18 @@ private val propertyReferenceLowering = makeWasmModulePhase( ) private val callableReferencePhase = makeWasmModulePhase( - ::WasmCallableReferenceLowering, + ::CallableReferenceLowering, name = "WasmCallableReferenceLowering", description = "Handle callable references" ) +private val singleAbstractMethodPhase = makeWasmModulePhase( + ::JsSingleAbstractMethodLowering, + name = "SingleAbstractMethod", + description = "Replace SAM conversions with instances of interface-implementing classes" +) + + private val localDelegatedPropertiesLoweringPhase = makeWasmModulePhase( { LocalDelegatedPropertiesLowering() }, name = "LocalDelegatedPropertiesLowering", @@ -455,6 +462,7 @@ val wasmPhases = NamedCompilerPhase( sharedVariablesLoweringPhase then propertyReferenceLowering then callableReferencePhase then + singleAbstractMethodPhase then localDelegatedPropertiesLoweringPhase then localDeclarationsLoweringPhase then localClassExtractionPhase then diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt index 50500b5e7cb..cbd9d866d12 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt @@ -52,6 +52,15 @@ fun compileWasm( ExternalDependenciesGenerator(symbolTable, listOf(deserializer)).generateUnboundSymbolsAsDependencies() } + // Preloading function interfaces that will potentially be referenced by IR lowering. + // TODO: Do a smart preload based on what references we have in IR and support big arity + repeat(22) { + irBuiltIns.functionN(it) + irBuiltIns.kFunctionN(it) + irBuiltIns.kSuspendFunctionN(it) + irBuiltIns.suspendFunctionN(it) + } + val irFiles = allModules.flatMap { it.files } moduleFragment.files.clear() moduleFragment.files += irFiles diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmCallableReferenceLowering.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmCallableReferenceLowering.kt deleted file mode 100644 index f241f0e6ff8..00000000000 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmCallableReferenceLowering.kt +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.backend.wasm.lower - -import org.jetbrains.kotlin.backend.common.FileLoweringPass -import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext -import org.jetbrains.kotlin.backend.common.ir.copyTo -import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor -import org.jetbrains.kotlin.backend.common.ir.isSuspend -import org.jetbrains.kotlin.backend.common.ir.moveBodyTo -import org.jetbrains.kotlin.backend.common.lower.createIrBuilder -import org.jetbrains.kotlin.backend.wasm.WasmBackendContext -import org.jetbrains.kotlin.descriptors.DescriptorVisibilities -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.ir.builders.* -import org.jetbrains.kotlin.ir.builders.declarations.* -import org.jetbrains.kotlin.ir.declarations.* -import org.jetbrains.kotlin.ir.expressions.* -import org.jetbrains.kotlin.ir.expressions.impl.IrInstanceInitializerCallImpl -import org.jetbrains.kotlin.ir.types.* -import org.jetbrains.kotlin.ir.util.* -import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.name.SpecialNames - -/** - * TODO: Temporary lowering stub. Needs to be redone. - * This is a copy of JVM lowering, but parts that don't compile are commented out. - * Turns out this works decently as a stub in most tests. - */ - -val IrStatementOrigin?.isLambda: Boolean - get() = this == IrStatementOrigin.LAMBDA || this == IrStatementOrigin.ANONYMOUS_FUNCTION - -// Originally copied from K/Native -internal class WasmCallableReferenceLowering(private val context: WasmBackendContext) : FileLoweringPass, - IrElementTransformerVoidWithContext() { - // This pass ignores suspend function references and function references used in inline arguments to inline functions. - private val ignoredFunctionReferences = mutableSetOf() - - private val IrFunctionReference.isIgnored: Boolean - get() = (!type.isFunctionOrKFunction() || ignoredFunctionReferences.contains(this)) && !isSuspendCallableReference() - - // TODO: Currently, origin of callable references is null. Do we need to create one? - private fun IrFunctionReference.isSuspendCallableReference(): Boolean = isSuspend && origin == null - - override fun lower(irFile: IrFile) { - // ignoredFunctionReferences.addAll(IrInlineReferenceLocator.scan(context, irFile)) - irFile.transformChildrenVoid(this) - } - - override fun visitBlock(expression: IrBlock): IrExpression { - if (!expression.origin.isLambda) - return super.visitBlock(expression) - - val reference = expression.statements.last() as IrFunctionReference - if (reference.isIgnored) - return super.visitBlock(expression) - - expression.statements.dropLast(1).forEach { it.transform(this, null) } - reference.transformChildrenVoid(this) - return FunctionReferenceBuilder(reference).build() - } - - override fun visitFunctionReference(expression: IrFunctionReference): IrExpression { - expression.transformChildrenVoid(this) - return if (expression.isIgnored) expression else FunctionReferenceBuilder(expression).build() - } - - // Handle SAM conversions which wrap a function reference: - // class sam$n(private val receiver: R) : Interface { override fun method(...) = receiver.target(...) } - // - // This avoids materializing an invokable KFunction representing, thus producing one less class. - // This is actually very common, as `Interface { something }` is a local function + a SAM-conversion - // of a reference to it into an implementation. - override fun visitTypeOperator(expression: IrTypeOperatorCall): IrExpression { - if (expression.operator == IrTypeOperator.SAM_CONVERSION) { - val invokable = expression.argument - val reference = if (invokable is IrFunctionReference) { - invokable - } else if (invokable is IrBlock && invokable.origin.isLambda && invokable.statements.last() is IrFunctionReference) { - invokable.statements.dropLast(1).forEach { it.transform(this, null) } - invokable.statements.last() as IrFunctionReference - } else { - return super.visitTypeOperator(expression) - } - reference.transformChildrenVoid() - return FunctionReferenceBuilder(reference, expression.typeOperand).build() - } - return super.visitTypeOperator(expression) - } - - private inner class FunctionReferenceBuilder(val irFunctionReference: IrFunctionReference, val samSuperType: IrType? = null) { - private val isLambda = irFunctionReference.origin.isLambda - - private val callee = irFunctionReference.symbol.owner - - // Only function references can bind a receiver and even then we can only bind either an extension or a dispatch receiver. - // However, when we bind a value of an inline class type as a receiver, the receiver will turn into an argument of - // the function in question. Yet we still need to record it as the "receiver" in CallableReference in order for reflection - // to work correctly. - private val boundReceiver: Pair? = irFunctionReference.getArgumentsWithIr().singleOrNull() - - // The type of the reference is KFunction - private val parameterTypes = (irFunctionReference.type as IrSimpleType).arguments.map { (it as IrTypeProjection).type } - private val argumentTypes = parameterTypes.dropLast(1) - private val referenceReturnType = parameterTypes.last() - - private val typeArgumentsMap = irFunctionReference.typeSubstitutionMap - - private val functionSuperClass = - samSuperType?.classOrNull - ?: if (irFunctionReference.isSuspend) - context.ir.symbols.suspendFunctionN(argumentTypes.size) - else - context.ir.symbols.functionN(argumentTypes.size) - - private val superMethod = - functionSuperClass.functions.single { it.owner.modality == Modality.ABSTRACT } - // TODO(WASM) - // private val superType = - // samSuperType ?: (if (isLambda) context.ir.symbols.lambdaClass else context.ir.symbols.functionReference).defaultType - - private val functionReferenceClass = context.irFactory.buildClass { - setSourceRange(irFunctionReference) - visibility = DescriptorVisibilities.LOCAL - // A callable reference results in a synthetic class, while a lambda is not synthetic. - // We don't produce GENERATED_SAM_IMPLEMENTATION, which is always synthetic. - // TODO(WASM) - // origin = if (isLambda) JvmLoweredDeclarationOrigin.LAMBDA_IMPL else JvmLoweredDeclarationOrigin.FUNCTION_REFERENCE_IMPL - name = SpecialNames.NO_NAME_PROVIDED - }.apply { - parent = currentDeclarationParent!! - // TODO(WASM) - // superTypes += superType - if (samSuperType == null) - superTypes += functionSuperClass.typeWith(parameterTypes) - // TODO(WASM) - // if (irFunctionReference.isSuspend) superTypes += context.ir.symbols.suspendFunctionInterface.defaultType - createImplicitParameterDeclarationWithWrappedDescriptor() - copyAttributes(irFunctionReference) - if (isLambda) { - this.metadata = irFunctionReference.symbol.owner.metadata - } - addField("receiver", context.irBuiltIns.anyNType) - } - -// WASM(TODO) -// private val receiverFieldFromSuper = context.ir.symbols.functionReferenceReceiverField.owner -// -// val fakeOverrideReceiverField = functionReferenceClass.addField { -// name = receiverFieldFromSuper.name -// origin = IrDeclarationOrigin.FAKE_OVERRIDE -// type = receiverFieldFromSuper.type -// isFinal = receiverFieldFromSuper.isFinal -// isStatic = receiverFieldFromSuper.isStatic -// visibility = receiverFieldFromSuper.visibility -// } - - fun build(): IrExpression = context.createIrBuilder(currentScope!!.scope.scopeOwnerSymbol).run { - irBlock { - val constructor = createConstructor() - createInvokeMethod( - if (samSuperType != null && boundReceiver != null) { - irTemporary(boundReceiver.second) - } else null - ) - -// WASM(TODO) -// if (!isLambda && samSuperType == null) { -// createGetSignatureMethod(this@run.irSymbols.functionReferenceGetSignature.owner) -// createGetNameMethod(this@run.irSymbols.functionReferenceGetName.owner) -// createGetOwnerMethod(this@run.irSymbols.functionReferenceGetOwner.owner) -// } - - +functionReferenceClass - +irCall(constructor.symbol).apply { - if (valueArgumentsCount > 0) putValueArgument(0, boundReceiver!!.second) - } - } - } - - private fun createConstructor(): IrConstructor = - functionReferenceClass.addConstructor { - // origin = JvmLoweredDeclarationOrigin.GENERATED_MEMBER_IN_CALLABLE_REFERENCE - returnType = functionReferenceClass.defaultType - isPrimary = true - }.apply { - // Add receiver parameter for bound function references - if (samSuperType == null) { - boundReceiver?.first?.let { param -> - valueParameters += param.copyTo( - irFunction = this, - index = 0, - type = param.type.substitute(typeArgumentsMap) - ) - } - } - - // Super constructor: - // - For SAM references, the super class is Any - // - For function references with bound receivers, accepts arity and receiver - // - For lambdas and function references without bound receivers, accepts arity - -// WASM_TODO -// val constructor = if (samSuperType != null) { -// context.irBuiltIns.anyClass.owner.constructors.single() -// } else { -// superType.getClass()!!.constructors.single { -// it.valueParameters.size == if (boundReceiver != null) 2 else 1 -// } -// } - - val constructor = context.irBuiltIns.anyClass.owner.constructors.single() - - body = context.createIrBuilder(symbol).irBlockBody(startOffset, endOffset) { - +irDelegatingConstructorCall(constructor).apply { -// WASM_TODO -// if (samSuperType == null) { -// putValueArgument(0, irInt(argumentTypes.size + if (irFunctionReference.isSuspend) 1 else 0)) -// if (boundReceiver != null) -// putValueArgument(1, irGet(valueParameters.first())) -// } - } - +IrInstanceInitializerCallImpl(startOffset, endOffset, functionReferenceClass.symbol, context.irBuiltIns.unitType) - if (samSuperType == null && boundReceiver != null) { - +irSetField( - irGet(functionReferenceClass.thisReceiver!!), - functionReferenceClass.fields.first(), - irGet(valueParameters.first()) - ) - } - } - } - - private fun createInvokeMethod(receiverVar: IrValueDeclaration?): IrSimpleFunction = - functionReferenceClass.addFunction { - setSourceRange(if (isLambda) callee else irFunctionReference) - name = superMethod.owner.name - returnType = callee.returnType - isSuspend = callee.isSuspend - }.apply { - overriddenSymbols += superMethod - dispatchReceiverParameter = parentAsClass.thisReceiver!!.copyTo(this) - if (isLambda) createLambdaInvokeMethod() else createFunctionReferenceInvokeMethod(receiverVar) - } - - // Inline the body of an anonymous function into the generated lambda subclass. - private fun IrSimpleFunction.createLambdaInvokeMethod() { - annotations += callee.annotations - val valueParameterMap = callee.explicitParameters.withIndex().associate { (index, param) -> - param to param.copyTo(this, index = index) - } - valueParameters += valueParameterMap.values - body = callee.moveBodyTo(this, valueParameterMap) - } - - private fun IrSimpleFunction.createFunctionReferenceInvokeMethod(receiver: IrValueDeclaration?) { - for ((index, argumentType) in argumentTypes.withIndex()) { - addValueParameter { - name = Name.identifier("p$index") - type = argumentType - } - } - - body = context.createIrBuilder(symbol, startOffset, endOffset).run { - var unboundIndex = 0 - val call = irCall(callee.symbol, referenceReturnType).apply { - for (typeParameter in irFunctionReference.symbol.owner.allTypeParameters) { - putTypeArgument(typeParameter.index, typeArgumentsMap[typeParameter.symbol]) - } - - for (parameter in callee.explicitParameters) { - when { - boundReceiver?.first == parameter -> - // Bound receiver parameter. For function references, this is stored in a field of the superclass. - // For sam references, we just capture the value in a local variable and LocalDeclarationsLowering - // will put it into a field. - if (samSuperType == null) - irImplicitCast( - irGetField( - irGet(dispatchReceiverParameter!!), - functionReferenceClass.fields.first(), - ), - boundReceiver.second.type - ) - else - irGet(receiver!!) - - unboundIndex >= argumentTypes.size -> - // Default value argument (this pass doesn't handle suspend functions, otherwise - // it could also be the continuation argument) - null - - else -> - irGet(valueParameters[unboundIndex++]) - }?.let { putArgument(callee, parameter, it) } - } - } - - irExprBody(call) - } - } - } -} diff --git a/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt b/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt index ac89418744f..de7df1991f6 100644 --- a/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt +++ b/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt @@ -274,7 +274,7 @@ fun loadIr( val createFunctionFactoryCallback = if (loadFunctionInterfacesIntoStdlib) { { packageFragmentDescriptor: PackageFragmentDescriptor -> - IrFileImpl(NaiveSourceBasedFileEntryImpl("[K][Suspend]Functions"), packageFragmentDescriptor, stdlibModule) + IrFileImpl(NaiveSourceBasedFileEntryImpl("${packageFragmentDescriptor.fqName}-[K][Suspend]Functions"), packageFragmentDescriptor, stdlibModule) .also { stdlibModule.files += it } } } else { diff --git a/compiler/testData/codegen/box/callableReference/bound/kCallableNameIntrinsic.kt b/compiler/testData/codegen/box/callableReference/bound/kCallableNameIntrinsic.kt index f0abaa3947b..557e76d4377 100644 --- a/compiler/testData/codegen/box/callableReference/bound/kCallableNameIntrinsic.kt +++ b/compiler/testData/codegen/box/callableReference/bound/kCallableNameIntrinsic.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: UNKNOWN // SKIP_SOURCEMAP_REMAPPING fun box(): String { diff --git a/compiler/testData/codegen/box/callableReference/equality/suspendConversion.kt b/compiler/testData/codegen/box/callableReference/equality/suspendConversion.kt index f6ed46fe12a..0c521662b72 100644 --- a/compiler/testData/codegen/box/callableReference/equality/suspendConversion.kt +++ b/compiler/testData/codegen/box/callableReference/equality/suspendConversion.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: COROUTINES // !LANGUAGE: +SuspendConversion // FILE: suspendCovnersion.kt diff --git a/compiler/testData/codegen/box/callableReference/function/classMemberFromCompanionObject.kt b/compiler/testData/codegen/box/callableReference/function/classMemberFromCompanionObject.kt index cf4d7630b62..c7be9b7a68f 100644 --- a/compiler/testData/codegen/box/callableReference/function/classMemberFromCompanionObject.kt +++ b/compiler/testData/codegen/box/callableReference/function/classMemberFromCompanionObject.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: CLASS_REFERENCES class C { fun OK() {} diff --git a/compiler/testData/codegen/box/callableReference/function/local/localFunctionName.kt b/compiler/testData/codegen/box/callableReference/function/local/localFunctionName.kt index 4ec3ab427d0..361ba4c3ce3 100644 --- a/compiler/testData/codegen/box/callableReference/function/local/localFunctionName.kt +++ b/compiler/testData/codegen/box/callableReference/function/local/localFunctionName.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: IGNORED_IN_JS fun box(): String { fun OK() {} diff --git a/compiler/testData/codegen/box/callableReference/function/sortListOfStrings.kt b/compiler/testData/codegen/box/callableReference/function/sortListOfStrings.kt index 88643432369..8161c822e83 100644 --- a/compiler/testData/codegen/box/callableReference/function/sortListOfStrings.kt +++ b/compiler/testData/codegen/box/callableReference/function/sortListOfStrings.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: STDLIB_SORT // WITH_RUNTIME // SKIP_DCE_DRIVEN diff --git a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt index 72168bfbb87..b13d2bb2e25 100644 --- a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt +++ b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface Foo { diff --git a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt index 8cb0a022042..ea1368517af 100644 --- a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt +++ b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // FILE: lib.kt diff --git a/compiler/testData/codegen/box/funInterface/castFromAny.kt b/compiler/testData/codegen/box/funInterface/castFromAny.kt index d20c0b662d9..51db56520e0 100644 --- a/compiler/testData/codegen/box/funInterface/castFromAny.kt +++ b/compiler/testData/codegen/box/funInterface/castFromAny.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions diff --git a/compiler/testData/codegen/box/funInterface/contravariantIntersectionType.kt b/compiler/testData/codegen/box/funInterface/contravariantIntersectionType.kt index e8990d132fc..f097a6e8863 100644 --- a/compiler/testData/codegen/box/funInterface/contravariantIntersectionType.kt +++ b/compiler/testData/codegen/box/funInterface/contravariantIntersectionType.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: BRIDGE_ISSUES // CHECK_BYTECODE_TEXT // 0 java/lang/invoke/LambdaMetafactory diff --git a/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype.kt b/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype.kt index 9debee20f81..b31fa421460 100644 --- a/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype.kt +++ b/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: BRIDGE_ISSUES // CHECK_BYTECODE_TEXT // 0 java/lang/invoke/LambdaMetafactory diff --git a/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype2.kt b/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype2.kt index 7eed37f0771..de7f51e0148 100644 --- a/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype2.kt +++ b/compiler/testData/codegen/box/funInterface/contravariantIntersectionTypeWithNonTrivialCommonSupertype2.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: BRIDGE_ISSUES // CHECK_BYTECODE_TEXT // 0 java/lang/invoke/LambdaMetafactory diff --git a/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt b/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt index c5e614a0296..bf1a1bf05aa 100644 --- a/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt +++ b/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 // FILE: test.kt diff --git a/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt b/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt index 2c89261d334..75dad97425c 100644 --- a/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt +++ b/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 // FILE: test.kt diff --git a/compiler/testData/codegen/box/funInterface/equality/lambdaRuntimeConversion.kt b/compiler/testData/codegen/box/funInterface/equality/lambdaRuntimeConversion.kt index e2aebb02c13..c57547aaa54 100644 --- a/compiler/testData/codegen/box/funInterface/equality/lambdaRuntimeConversion.kt +++ b/compiler/testData/codegen/box/funInterface/equality/lambdaRuntimeConversion.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 // FILE: test.kt diff --git a/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt b/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt index b24033713d1..a2c4ec0b172 100644 --- a/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt +++ b/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 fun checkEqual(x: Any, y: Any) { diff --git a/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt b/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt index 197cea0a3cf..5dc007dbd2b 100644 --- a/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt +++ b/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument fun interface MyRunnable { diff --git a/compiler/testData/codegen/box/funInterface/funInterfaceCallInLambda.kt b/compiler/testData/codegen/box/funInterface/funInterfaceCallInLambda.kt index 6f0b9da229e..12b27e7e3cf 100644 --- a/compiler/testData/codegen/box/funInterface/funInterfaceCallInLambda.kt +++ b/compiler/testData/codegen/box/funInterface/funInterfaceCallInLambda.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: WASM fun interface Action { fun run() diff --git a/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt b/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt index 84310892eec..81a3e135b25 100644 --- a/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt +++ b/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface Base { diff --git a/compiler/testData/codegen/box/funInterface/funInterfaceWithReceiver.kt b/compiler/testData/codegen/box/funInterface/funInterfaceWithReceiver.kt index 3eb17068832..fe22e0b4999 100644 --- a/compiler/testData/codegen/box/funInterface/funInterfaceWithReceiver.kt +++ b/compiler/testData/codegen/box/funInterface/funInterfaceWithReceiver.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // IGNORE_BACKEND: JS_IR_ES6 fun interface FunWithReceiver { diff --git a/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt b/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt index 9ad7d715def..30e520ea6dc 100644 --- a/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt +++ b/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/funInterface/intersectionTypeToFunInterfaceConversion.kt b/compiler/testData/codegen/box/funInterface/intersectionTypeToFunInterfaceConversion.kt index 99b90a941b4..ceac246720a 100644 --- a/compiler/testData/codegen/box/funInterface/intersectionTypeToFunInterfaceConversion.kt +++ b/compiler/testData/codegen/box/funInterface/intersectionTypeToFunInterfaceConversion.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR // IGNORE_BACKEND: JS_IR_ES6 diff --git a/compiler/testData/codegen/box/funInterface/irrelevantPrivateDeclarations.kt b/compiler/testData/codegen/box/funInterface/irrelevantPrivateDeclarations.kt index b5cf475c056..6aba80b51f6 100644 --- a/compiler/testData/codegen/box/funInterface/irrelevantPrivateDeclarations.kt +++ b/compiler/testData/codegen/box/funInterface/irrelevantPrivateDeclarations.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS fun interface A { fun invoke(s: String) diff --git a/compiler/testData/codegen/box/funInterface/kt45444_privateFunInterface.kt b/compiler/testData/codegen/box/funInterface/kt45444_privateFunInterface.kt index bac7d526181..a0ac0f373ca 100644 --- a/compiler/testData/codegen/box/funInterface/kt45444_privateFunInterface.kt +++ b/compiler/testData/codegen/box/funInterface/kt45444_privateFunInterface.kt @@ -1,6 +1,4 @@ // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS private fun interface Listener { fun onChanged(): String diff --git a/compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt b/compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt index cebc730b293..ddebd25f3dd 100644 --- a/compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt +++ b/compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// IGNORE_BACKEND: WASM class C : Comparable { override fun compareTo(other: C): Int = 0 diff --git a/compiler/testData/codegen/box/funInterface/multimodule.kt b/compiler/testData/codegen/box/funInterface/multimodule.kt index 6d4699342d8..764eb3d1e68 100644 --- a/compiler/testData/codegen/box/funInterface/multimodule.kt +++ b/compiler/testData/codegen/box/funInterface/multimodule.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // MODULE: m1 diff --git a/compiler/testData/codegen/box/funInterface/noOptimizedCallableReferences.kt b/compiler/testData/codegen/box/funInterface/noOptimizedCallableReferences.kt index b531803c641..f5eb12eb3e4 100644 --- a/compiler/testData/codegen/box/funInterface/noOptimizedCallableReferences.kt +++ b/compiler/testData/codegen/box/funInterface/noOptimizedCallableReferences.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // NO_OPTIMIZED_CALLABLE_REFERENCES fun interface P { diff --git a/compiler/testData/codegen/box/funInterface/nonAbstractMethod.kt b/compiler/testData/codegen/box/funInterface/nonAbstractMethod.kt index d1d3916bdba..e190edbd2dc 100644 --- a/compiler/testData/codegen/box/funInterface/nonAbstractMethod.kt +++ b/compiler/testData/codegen/box/funInterface/nonAbstractMethod.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS interface I { fun inherited(s: String): String = privateInherited(s) diff --git a/compiler/testData/codegen/box/funInterface/nullableSam.kt b/compiler/testData/codegen/box/funInterface/nullableSam.kt index 3c588602625..ce5456238ab 100644 --- a/compiler/testData/codegen/box/funInterface/nullableSam.kt +++ b/compiler/testData/codegen/box/funInterface/nullableSam.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/funInterface/partialSam.kt b/compiler/testData/codegen/box/funInterface/partialSam.kt index 67bf7a61181..f33c10526c2 100644 --- a/compiler/testData/codegen/box/funInterface/partialSam.kt +++ b/compiler/testData/codegen/box/funInterface/partialSam.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/funInterface/primitiveConversions.kt b/compiler/testData/codegen/box/funInterface/primitiveConversions.kt index bfa6a44f5f9..5ef596ad9d8 100644 --- a/compiler/testData/codegen/box/funInterface/primitiveConversions.kt +++ b/compiler/testData/codegen/box/funInterface/primitiveConversions.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // This test should check argument coercion between the SAM and the lambda. diff --git a/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt b/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt index 98b6a180255..d23a0636950 100644 --- a/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt +++ b/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/funInterface/samConstructorExplicitInvocation.kt b/compiler/testData/codegen/box/funInterface/samConstructorExplicitInvocation.kt index 0a7d365c203..03b20212dd4 100644 --- a/compiler/testData/codegen/box/funInterface/samConstructorExplicitInvocation.kt +++ b/compiler/testData/codegen/box/funInterface/samConstructorExplicitInvocation.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +FunctionalInterfaceConversion fun interface S { diff --git a/compiler/testData/codegen/box/funInterface/samConversionToGenericInterfaceInGenericFun.kt b/compiler/testData/codegen/box/funInterface/samConversionToGenericInterfaceInGenericFun.kt index 576637444c5..61b149afe4d 100644 --- a/compiler/testData/codegen/box/funInterface/samConversionToGenericInterfaceInGenericFun.kt +++ b/compiler/testData/codegen/box/funInterface/samConversionToGenericInterfaceInGenericFun.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS fun interface FunIFace { fun call(ic: T): R diff --git a/compiler/testData/codegen/box/funInterface/subtypeOfFunctionalTypeToFunInterfaceConversion.kt b/compiler/testData/codegen/box/funInterface/subtypeOfFunctionalTypeToFunInterfaceConversion.kt index e0a87ad72f8..5084a208d40 100644 --- a/compiler/testData/codegen/box/funInterface/subtypeOfFunctionalTypeToFunInterfaceConversion.kt +++ b/compiler/testData/codegen/box/funInterface/subtypeOfFunctionalTypeToFunInterfaceConversion.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR // IGNORE_BACKEND: JS_IR_ES6 diff --git a/compiler/testData/codegen/box/inference/builderInference/kt47744.kt b/compiler/testData/codegen/box/inference/builderInference/kt47744.kt index 5b2f33d39a0..748a7ce7517 100644 --- a/compiler/testData/codegen/box/inference/builderInference/kt47744.kt +++ b/compiler/testData/codegen/box/inference/builderInference/kt47744.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +UnrestrictedBuilderInference // WITH_RUNTIME -// IGNORE_BACKEND: WASM import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt index 5309238fcf3..13da006308c 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// IGNORE_BACKEND: WASM // !LANGUAGE: -StrictOnlyInputTypesChecks import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt index e1bc73ed33c..6ab9def3000 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt @@ -1,7 +1,6 @@ // WITH_RUNTIME // SKIP_TXT // !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNCHECKED_CAST -UNUSED_PARAMETER -UNUSED_VARIABLE -OPT_IN_USAGE_ERROR -UNUSED_EXPRESSION -// IGNORE_BACKEND: WASM import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt index 5309238fcf3..13da006308c 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// IGNORE_BACKEND: WASM // !LANGUAGE: -StrictOnlyInputTypesChecks import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt index d22b2bf001b..892c83ba9f2 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// IGNORE_BACKEND: WASM import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt b/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt index 25b39a1c8c1..60074d829aa 100644 --- a/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt +++ b/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: COROUTINES // Issues: KT-33542, KT-33544 // WITH_RUNTIME // !LANGUAGE: +NewInference diff --git a/compiler/testData/codegen/box/inference/kt35684.kt b/compiler/testData/codegen/box/inference/kt35684.kt index f75d53a2fba..0cb98a66d87 100644 --- a/compiler/testData/codegen/box/inference/kt35684.kt +++ b/compiler/testData/codegen/box/inference/kt35684.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: COROUTINES // !LANGUAGE: +NewInference // !OPT_IN: kotlin.RequiresOptIn // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt b/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt index f9b021f9760..b6d4ea8c3ec 100644 --- a/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt +++ b/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: COROUTINES // WITH_RUNTIME import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt b/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt index 67eb49c1be6..6169262e158 100644 --- a/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt +++ b/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: COROUTINES // WITH_RUNTIME // !LANGUAGE: +NewInference diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt index 290738a191f..1cb36cd4b91 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt @@ -1,5 +1,5 @@ // WITH_RUNTIME -// IGNORE_BACKEND: WASM + inline class Result(val isSuccess: Boolean) diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/argumentResult.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/argumentResult.kt index cbb493ab5b7..c33afc313fe 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/argumentResult.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/argumentResult.kt @@ -1,6 +1,5 @@ // WITH_RUNTIME // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM fun interface ResultHandler { fun onResult(result: Result) diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt index 19d7612391a..0db1af93a74 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM // !LANGUAGE: +InlineClasses inline class A(val value: String) diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt index 57aaf59e7ae..cf6e4180138 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// IGNORE_BACKEND: WASM // IGNORE_BACKEND: JVM inline class Result(val isSuccess: Boolean) diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/returnResult.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/returnResult.kt index 2127a0d377d..9e73253c4c9 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/returnResult.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/returnResult.kt @@ -1,6 +1,5 @@ // WITH_RUNTIME // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM fun interface ResultHandler { @Suppress("RESULT_CLASS_IN_RETURN_TYPE") diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt index fb50457aec8..20cb9d58063 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: BRIDGE_ISSUES // !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt b/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt index 2adb206661c..6434b3fa631 100644 --- a/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt +++ b/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: WASM // MODULE: lib // FILE: lib.kt diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt index f3417dfa380..555df6d08ae 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses fun underlying(a: IC): T = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt index 603b76130a3..a13cbf30be8 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses fun underlying(a: IC): T = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt index 03d0fb4b301..97146b302bf 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses fun underlying(a: IC): T = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt index f7a5e288950..a2368761b61 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses fun underlying(a: IC): T = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt index 091a510023b..3a59a80d322 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt index 90eeb02589e..05c0d999fda 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses fun underlying(a: IC): T1 = bar(a) { it.value as T1 } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt index b1eda9d6f90..4537fa84cf7 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt index 9c6794209cd..8ed679143c3 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt index 0af725f62d7..9d84cf1a01c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS // !LANGUAGE: +InlineClasses fun underlying(a: IC): T = bar(a) { diff --git a/compiler/testData/codegen/box/sam/approximation/approxToSingleUpperBound.kt b/compiler/testData/codegen/box/sam/approximation/approxToSingleUpperBound.kt index 28078eb431a..05c614e3a73 100644 --- a/compiler/testData/codegen/box/sam/approximation/approxToSingleUpperBound.kt +++ b/compiler/testData/codegen/box/sam/approximation/approxToSingleUpperBound.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: WASM interface X interface Z diff --git a/compiler/testData/codegen/box/sam/constructors/nonLiteralComparator.kt b/compiler/testData/codegen/box/sam/constructors/nonLiteralComparator.kt index be8a3696389..da8b086ca85 100644 --- a/compiler/testData/codegen/box/sam/constructors/nonLiteralComparator.kt +++ b/compiler/testData/codegen/box/sam/constructors/nonLiteralComparator.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: SAM_CONVERSIONS +// WASM_MUTE_REASON: STDLIB_SORT // WITH_RUNTIME // SKIP_DCE_DRIVEN diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt index 0bb2f12ef95..2d250e286c0 100644 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt +++ b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionDefault.kt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionDefault.kt index b56c17c0fca..d1ead7f52fa 100644 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionDefault.kt +++ b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionDefault.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt index 6e2c7c02f3b..4c3a81696eb 100644 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt +++ b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -// IGNORE_BACKEND: WASM fun foo1(f: suspend () -> Unit) {} fun bar1() {} diff --git a/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt b/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt index c3cdcdcd1d9..454be32d7cf 100644 --- a/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt +++ b/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt @@ -1,7 +1,6 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM var foo1 = false var foo2 = false diff --git a/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt b/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt index e131f01169f..23362be1de5 100644 --- a/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt +++ b/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt @@ -2,7 +2,6 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM fun foo(f: () -> String, g: suspend () -> String, h: suspend () -> String) {} diff --git a/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt b/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt index 2a4c1633378..68f75e272af 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt @@ -1,7 +1,6 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM // IGNORE_BACKEND_FIR: JVM_IR fun interface Runnable { diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt index 6dba04bfd41..c910d6024c4 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt @@ -1,7 +1,6 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION // WITH_RUNTIME -// IGNORE_BACKEND: WASM // IGNORE_BACKEND_FIR: JVM_IR object Test1 { diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt index 1599aab5ff1..d8940be6cc1 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt @@ -2,7 +2,6 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER // IGNORE_BACKEND: JVM -// IGNORE_BACKEND: WASM // IGNORE_BACKEND_FIR: JVM_IR fun useSuspendVararg(vararg sfn: suspend () -> Unit) {} diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt index e9418ccb53d..8c0e29359c6 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt @@ -1,7 +1,6 @@ // FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -// IGNORE_BACKEND: WASM fun unitCoercion(f: suspend () -> Unit) {} fun foo(): Int = 0 diff --git a/libraries/stdlib/wasm/internal/kotlin/wasm/internal/KPropertyImpl.kt b/libraries/stdlib/wasm/internal/kotlin/wasm/internal/KPropertyImpl.kt index 63b9e68a5ae..4b05bd56617 100644 --- a/libraries/stdlib/wasm/internal/kotlin/wasm/internal/KPropertyImpl.kt +++ b/libraries/stdlib/wasm/internal/kotlin/wasm/internal/KPropertyImpl.kt @@ -10,7 +10,7 @@ package kotlin.wasm.internal import kotlin.UnsupportedOperationException import kotlin.reflect.* -internal open class KProperty0Impl(override val name: String, override val returnType: KType, val getter: () -> R) : KProperty0 { +internal open class KProperty0Impl(override val name: String, val returnType: KType, val getter: () -> R) : KProperty0 { override fun get(): R { return getter() } @@ -34,7 +34,7 @@ internal open class KProperty0Impl(override val name: String, override va } } -internal open class KProperty1Impl(override val name: String, override val returnType: KType, val getter: (T) -> R) : KProperty1 { +internal open class KProperty1Impl(override val name: String, val returnType: KType, val getter: (T) -> R) : KProperty1 { override fun get(receiver: T): R { return getter(receiver) } @@ -58,7 +58,7 @@ internal open class KProperty1Impl(override val name: String, override } } -internal open class KProperty2Impl(override val name: String, override val returnType: KType, val getter: (T1, T2) -> R) : +internal open class KProperty2Impl(override val name: String, val returnType: KType, val getter: (T1, T2) -> R) : KProperty2 { override fun get(receiver1: T1, receiver2: T2): R { return getter(receiver1, receiver2) @@ -146,7 +146,7 @@ internal class KMutableProperty2Impl(name: String, returnType: KType, } } -internal open class KLocalDelegatedPropertyImpl(override val name: String, override val returnType: KType) : KProperty0 { +internal open class KLocalDelegatedPropertyImpl(override val name: String, val returnType: KType) : KProperty0 { override fun get(): R { throw UnsupportedOperationException("Not supported for local property reference.") } diff --git a/libraries/stdlib/wasm/src/kotlin/reflect/KCallable.kt b/libraries/stdlib/wasm/src/kotlin/reflect/KCallable.kt index 0450798e013..15a8c0ec4f2 100644 --- a/libraries/stdlib/wasm/src/kotlin/reflect/KCallable.kt +++ b/libraries/stdlib/wasm/src/kotlin/reflect/KCallable.kt @@ -20,10 +20,4 @@ public actual interface KCallable { * the setter, similarly, will have the name "". */ actual public val name: String - - - /** - * The type of values returned by this callable. - */ - public val returnType: KType }