Move SuspendFunction{N} interfaces to kotlin.coroutines package

#KT-25824: Fixed
This commit is contained in:
Ilmir Usmanov
2018-08-16 20:44:09 +03:00
parent 4a7703ed66
commit 0559cfb724
26 changed files with 111 additions and 103 deletions
@@ -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()) {
@@ -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");
@@ -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");