Remove kotlin.coroutine package from default imports.
This commit is contained in:
committed by
Stanislav Erokhin
parent
7d1b883171
commit
0132f3eea7
+3
-5
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
@@ -25,7 +24,6 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
val SUSPEND_WITH_CURRENT_CONTINUATION_NAME = Name.identifier("suspendWithCurrentContinuation")
|
||||
|
||||
fun FunctionDescriptor.getBuiltInSuspendWithCurrentContinuation() =
|
||||
builtIns.builtInsPackageFragments.singleOrNull { it.fqName == KotlinBuiltIns.COROUTINES_PACKAGE_FQ_NAME }
|
||||
?.getMemberScope()
|
||||
?.getContributedFunctions(SUSPEND_WITH_CURRENT_CONTINUATION_NAME, NoLookupLocation.FROM_BACKEND)
|
||||
?.singleOrNull()
|
||||
builtIns.builtInsCoroutinePackageFragment.getMemberScope()
|
||||
.getContributedFunctions(SUSPEND_WITH_CURRENT_CONTINUATION_NAME, NoLookupLocation.FROM_BACKEND)
|
||||
.singleOrNull()
|
||||
|
||||
@@ -42,7 +42,7 @@ object JvmPlatform : TargetPlatform("JVM") {
|
||||
}
|
||||
|
||||
val builtIns = JvmBuiltIns(LockBasedStorageManager.NO_LOCKS)
|
||||
for (builtinPackageFragment in builtIns.builtInsPackageFragments) {
|
||||
for (builtinPackageFragment in builtIns.builtInsPackageFragmentsImportedByDefault) {
|
||||
addAllClassifiersFromScope(builtinPackageFragment.getMemberScope())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ abstract class TargetPlatform(val platformName: String) {
|
||||
add(ImportPath("kotlin.*"))
|
||||
add(ImportPath("kotlin.annotation.*"))
|
||||
add(ImportPath("kotlin.collections.*"))
|
||||
add(ImportPath("kotlin.coroutines.*"))
|
||||
add(ImportPath("kotlin.ranges.*"))
|
||||
add(ImportPath("kotlin.sequences.*"))
|
||||
add(ImportPath("kotlin.text.*"))
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>c<!>: <!UNRESOLVED_REFERENCE!>Continuation<!><Unit>) {}
|
||||
|
||||
// FILE: 2.kt
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun test2(<!UNUSED_PARAMETER!>c<!>: Continuation<Unit>) {}
|
||||
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ c: [ERROR : Continuation<Unit>]<kotlin.Unit>): kotlin.Unit
|
||||
public fun test2(/*0*/ c: kotlin.coroutines.Continuation<kotlin.Unit>): kotlin.Unit
|
||||
@@ -4276,6 +4276,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noDefaultCoroutineImports.kt")
|
||||
public void testNoDefaultCoroutineImports() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/coroutines/noDefaultCoroutineImports.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalSuspension.kt")
|
||||
public void testNonLocalSuspension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/coroutines/nonLocalSuspension.kt");
|
||||
|
||||
Reference in New Issue
Block a user