diff --git a/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt b/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt index 7005b67226f..ceb0ff9d082 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt @@ -346,7 +346,7 @@ class LazyModuleDependencies( ) : ModuleDependencies { private val dependencies = storageManager.createLazyValue { val moduleDescriptor = resolverForProject.descriptorForModule(module) - buildSequence { + buildSequence { if (firstDependency != null) { yield(resolverForProject.descriptorForModule(firstDependency)) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt index aebd5990059..9a0b07c0465 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt @@ -715,7 +715,7 @@ class DoubleColonExpressionResolver( ?.apply { commitTrace() }?.results } - val resultSequence = buildSequence { + val resultSequence = buildSequence { when (lhs) { is DoubleColonLHS.Type -> { val classifier = lhsType.constructor.declarationDescriptor diff --git a/compiler/tests/org/jetbrains/kotlin/scripts/ScriptProviderTest.kt b/compiler/tests/org/jetbrains/kotlin/scripts/ScriptProviderTest.kt index 25ebdb722a8..13d8438835a 100644 --- a/compiler/tests/org/jetbrains/kotlin/scripts/ScriptProviderTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/scripts/ScriptProviderTest.kt @@ -71,7 +71,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 = buildSequence { + override val definitions: Sequence = buildSequence { for (gen in defGens) { counter.incrementAndGet() yield(gen()) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/getModuleInfo.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/getModuleInfo.kt index aceece35b7f..29fd3ce8836 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/getModuleInfo.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/getModuleInfo.kt @@ -121,7 +121,7 @@ private sealed class ModuleInfoCollector( emptySequence() }, virtualFileProcessor = { project, virtualFile, isLibrarySource -> - buildSequence { + buildSequence { collectInfosByVirtualFile( project, virtualFile, diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt index c8caf833439..a017ba33bdb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt @@ -233,7 +233,7 @@ private class TemplateTokenSequence(private val inputString: String) : Sequence< if (inputString.isEmpty()) { return emptySequence().iterator() } - return buildIterator { + return buildIterator { var from = 0 var to = 0 while (to < inputString.length) { diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/TemplateGroups.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/TemplateGroups.kt index 109c2041840..f9ff22a386c 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/TemplateGroups.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/TemplateGroups.kt @@ -17,7 +17,7 @@ fun templateGroupOf(vararg templates: MemberTemplate): TemplateGroup = { templat abstract class TemplateGroupBase : TemplateGroup { - override fun invoke(): Sequence = buildSequence { + override fun invoke(): Sequence = buildSequence { with(this@TemplateGroupBase) { this::class.members.filter { it.name.startsWith("f_") }.forEach { require(it.parameters.size == 1) { "Member $it violates naming convention" } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Templates.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Templates.kt index 7a50fc3d2fe..1042dbc449f 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Templates.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Templates.kt @@ -184,7 +184,7 @@ class FamilyPrimitiveMemberDefinition : MemberTemplateDefinition } } - override fun parametrize(): Sequence> = buildSequence> { + override fun parametrize(): Sequence> = buildSequence { for ((family, primitives) in familyPrimitives) { if (primitives.isEmpty()) yield(family to null) diff --git a/plugins/scripting/scripting-cli/src/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptiDefinitionsFromClasspathDiscoverySource.kt b/plugins/scripting/scripting-cli/src/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptiDefinitionsFromClasspathDiscoverySource.kt index de18bece544..b03a34d7156 100644 --- a/plugins/scripting/scripting-cli/src/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptiDefinitionsFromClasspathDiscoverySource.kt +++ b/plugins/scripting/scripting-cli/src/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptiDefinitionsFromClasspathDiscoverySource.kt @@ -45,7 +45,7 @@ internal fun discoverScriptTemplatesInClasspath( baseClassLoader: ClassLoader, scriptResolverEnv: Map, messageCollector: MessageCollector -): Sequence = buildSequence { +): Sequence = buildSequence { // TODO: try to find a way to reduce classpath (and classloader) to minimal one needed to load script definition and its dependencies val loader = LazyClasspathWithClassLoader(baseClassLoader) { classpath } @@ -133,7 +133,7 @@ internal fun loadScriptTemplatesFromClasspath( messageCollector: MessageCollector ): Sequence = if (scriptTemplates.isEmpty()) emptySequence() - else buildSequence { + else buildSequence { // trying the direct classloading from baseClassloader first, since this is the most performant variant val (initialLoadedDefinitions, initialNotFoundTemplates) = scriptTemplates.partitionMapNotNull { loadScriptDefinition(baseClassLoader, it, scriptResolverEnv, messageCollector)