Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.js.naming
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.isSuspendFunctionType
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
@@ -80,7 +81,11 @@ private fun StringBuilder.encodeForSignature(
|
||||
return append(typeParameterNamer(declaration))
|
||||
}
|
||||
|
||||
append(DescriptorUtils.getFqName(declaration).asString())
|
||||
if (type.isSuspendFunctionType) {
|
||||
append(DescriptorUtils.getFqName(declaration).asString().replace("kotlin.coroutines.SuspendFunction", "kotlin.SuspendFunction"))
|
||||
} else {
|
||||
append(DescriptorUtils.getFqName(declaration).asString())
|
||||
}
|
||||
|
||||
val parameters = declaration.typeConstructor.parameters
|
||||
if (type.arguments.isNotEmpty() && parameters.isNotEmpty()) {
|
||||
|
||||
-5
@@ -5665,11 +5665,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFunction12.kt")
|
||||
public void testSuspendFunction12() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/featureIntersection/suspendFunction12.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFunctionIsAs.kt")
|
||||
public void testSuspendFunctionIsAs() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/featureIntersection/suspendFunctionIsAs.kt");
|
||||
|
||||
-5
@@ -6220,11 +6220,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFunction12.kt")
|
||||
public void testSuspendFunction12() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/featureIntersection/suspendFunction12.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFunctionIsAs.kt")
|
||||
public void testSuspendFunctionIsAs() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/featureIntersection/suspendFunctionIsAs.kt");
|
||||
|
||||
Reference in New Issue
Block a user