From f654db42054b9cac64564bded36273d989cfb099 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Mon, 15 Oct 2018 11:20:00 +0300 Subject: [PATCH] Fix regression after migrating to release coroutines: createCoroutinesOnManualInstances.kt test. Also remove obsolete references to kotlin.coroutines.experimental --- .../src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt | 3 +++ .../backend/konan/lower/CallableReferenceLowering.kt | 6 +----- .../kotlin/backend/konan/lower/SuspendFunctionsLowering.kt | 7 ------- runtime/src/main/kotlin/kotlin/sequences/Sequences.kt | 1 - 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt index 0aac107c07c..3aecb7a484c 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt @@ -368,6 +368,9 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val private val coroutinesPackage = context.builtIns.builtInsModule.getPackage( context.config.configuration.languageVersionSettings.coroutinesPackageFqName()).memberScope + val continuationClassDescriptor = coroutinesPackage + .getContributedClassifier(Name.identifier("Continuation"), NoLookupLocation.FROM_BACKEND) as ClassDescriptor + val coroutineContextGetter = coroutinesPackage .getContributedVariables(Name.identifier("coroutineContext"), NoLookupLocation.FROM_BACKEND) .single() diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt index cebbac1c23e..14335153ab1 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt @@ -127,13 +127,9 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass private class BuiltFunctionReference(val functionReferenceClass: IrClass, val functionReferenceConstructor: IrConstructor) - private val COROUTINES_FQ_NAME = FqName.fromSegments(listOf("kotlin", "coroutines", "experimental")) private val VOLATILE_LAMBDA_FQ_NAME = FqName.fromSegments(listOf("kotlin", "native", "internal", "VolatileLambda")) - private val coroutinesScope = context.irModule!!.descriptor.getPackage(COROUTINES_FQ_NAME).memberScope - - private val continuationClassDescriptor = coroutinesScope - .getContributedClassifier(Name.identifier("Continuation"), NoLookupLocation.FROM_BACKEND) as ClassDescriptor + private val continuationClassDescriptor = context.ir.symbols.continuationClassDescriptor private val getContinuationSymbol = context.ir.symbols.getContinuation diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt index 7e8d0ec484b..cdb2f7c97ed 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt @@ -34,7 +34,6 @@ import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.* -import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.storage.LockBasedStorageManager @@ -252,12 +251,6 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass val coroutineConstructor: IrConstructor, val invokeSuspendFunction: IrFunction) - private val COROUTINES_FQ_NAME = FqName.fromSegments(listOf("kotlin", "coroutines", "experimental")) - private val KOTLIN_FQ_NAME = FqName("kotlin") - - private val coroutinesScope = context.irModule!!.descriptor.getPackage(COROUTINES_FQ_NAME).memberScope - private val kotlinPackageScope = context.irModule!!.descriptor.getPackage(KOTLIN_FQ_NAME).memberScope - private inner class CoroutineBuilder(val irFunction: IrFunction, val functionReference: IrFunctionReference?) { private val functionParameters = irFunction.explicitParameters diff --git a/runtime/src/main/kotlin/kotlin/sequences/Sequences.kt b/runtime/src/main/kotlin/kotlin/sequences/Sequences.kt index d552c70d57a..24c1fbd87b0 100644 --- a/runtime/src/main/kotlin/kotlin/sequences/Sequences.kt +++ b/runtime/src/main/kotlin/kotlin/sequences/Sequences.kt @@ -6,7 +6,6 @@ package kotlin.sequences import kotlin.comparisons.* -import kotlin.coroutines.experimental.* import kotlin.native.internal.FixmeConcurrency @FixmeConcurrency