Migrate to release coroutines
This commit is contained in:
committed by
Ilmir Usmanov
parent
bbc73ec0e5
commit
0191e3d1cf
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.script
|
||||
|
||||
import kotlinx.coroutines.experimental.runBlocking
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlin.script.experimental.dependencies.DependenciesResolver
|
||||
import kotlin.script.dependencies.Environment
|
||||
import kotlin.script.dependencies.ScriptContents
|
||||
|
||||
@@ -45,7 +45,6 @@ import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
import org.jetbrains.kotlin.storage.getValue
|
||||
import java.util.*
|
||||
import kotlin.coroutines.experimental.buildSequence
|
||||
|
||||
class ResolverForModule(
|
||||
val packageFragmentProvider: PackageFragmentProvider,
|
||||
@@ -346,7 +345,7 @@ class LazyModuleDependencies<M : ModuleInfo>(
|
||||
) : ModuleDependencies {
|
||||
private val dependencies = storageManager.createLazyValue {
|
||||
val moduleDescriptor = resolverForProject.descriptorForModule(module)
|
||||
buildSequence {
|
||||
sequence {
|
||||
if (firstDependency != null) {
|
||||
yield(resolverForProject.descriptorForModule(firstDependency))
|
||||
}
|
||||
|
||||
+2
-3
@@ -53,7 +53,6 @@ import org.jetbrains.kotlin.types.typeUtil.makeNullable
|
||||
import org.jetbrains.kotlin.utils.yieldIfNotNull
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import kotlin.coroutines.experimental.buildSequence
|
||||
|
||||
sealed class DoubleColonLHS(val type: KotlinType) {
|
||||
/**
|
||||
@@ -715,13 +714,13 @@ class DoubleColonExpressionResolver(
|
||||
?.apply { commitTrace() }?.results
|
||||
}
|
||||
|
||||
val resultSequence = buildSequence {
|
||||
val resultSequence = sequence {
|
||||
when (lhs) {
|
||||
is DoubleColonLHS.Type -> {
|
||||
val classifier = lhsType.constructor.declarationDescriptor
|
||||
if (classifier !is ClassDescriptor) {
|
||||
c.trace.report(CALLABLE_REFERENCE_LHS_NOT_A_CLASS.on(expression))
|
||||
return@buildSequence
|
||||
return@sequence
|
||||
}
|
||||
|
||||
val qualifier = c.trace.get(BindingContext.QUALIFIER, expression.receiverExpression!!)
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import kotlin.coroutines.experimental.buildSequence
|
||||
import kotlin.script.templates.standard.ScriptTemplateWithArgs
|
||||
|
||||
class ScriptProviderTest : KtUsefulTestCase() {
|
||||
@@ -71,7 +70,7 @@ private class TestScriptDefinitionSource(val counter: AtomicInteger, val defGens
|
||||
{
|
||||
constructor(counter: AtomicInteger, vararg suffixes: String) : this(counter, suffixes.map { { FakeScriptDefinition(it) } })
|
||||
|
||||
override val definitions: Sequence<KotlinScriptDefinition> = buildSequence {
|
||||
override val definitions: Sequence<KotlinScriptDefinition> = sequence {
|
||||
for (gen in defGens) {
|
||||
counter.incrementAndGet()
|
||||
yield(gen())
|
||||
|
||||
Reference in New Issue
Block a user