Remove experimental coroutines usages from stdlib generator

This commit is contained in:
Ilya Gorbunov
2018-10-26 05:45:04 +03:00
parent e39953c4a0
commit 138ab13364
3 changed files with 3 additions and 6 deletions
@@ -11,7 +11,7 @@ dependencies {
compileKotlin { compileKotlin {
kotlinOptions { kotlinOptions {
freeCompilerArgs = ["-version", "-Xnormalize-constructor-calls=enable", "-XXLanguage:-ReleaseCoroutines"] freeCompilerArgs = ["-version"]
} }
} }
@@ -5,7 +5,6 @@
package templates package templates
import kotlin.coroutines.experimental.buildSequence
import kotlin.reflect.KTypeProjection import kotlin.reflect.KTypeProjection
import kotlin.reflect.full.createType import kotlin.reflect.full.createType
import kotlin.reflect.full.isSubtypeOf import kotlin.reflect.full.isSubtypeOf
@@ -17,7 +16,7 @@ fun templateGroupOf(vararg templates: MemberTemplate): TemplateGroup = { templat
abstract class TemplateGroupBase : TemplateGroup { abstract class TemplateGroupBase : TemplateGroup {
override fun invoke(): Sequence<MemberTemplate> = buildSequence { override fun invoke(): Sequence<MemberTemplate> = sequence {
with(this@TemplateGroupBase) { with(this@TemplateGroupBase) {
this::class.members.filter { it.name.startsWith("f_") }.forEach { this::class.members.filter { it.name.startsWith("f_") }.forEach {
require(it.parameters.size == 1) { "Member $it violates naming convention" } require(it.parameters.size == 1) { "Member $it violates naming convention" }
@@ -5,8 +5,6 @@
package templates package templates
import kotlin.coroutines.experimental.*
@DslMarker @DslMarker
annotation class TemplateDsl annotation class TemplateDsl
@@ -184,7 +182,7 @@ class FamilyPrimitiveMemberDefinition : MemberTemplateDefinition<PrimitiveType?>
} }
} }
override fun parametrize(): Sequence<Pair<Family, PrimitiveType?>> = buildSequence { override fun parametrize(): Sequence<Pair<Family, PrimitiveType?>> = sequence {
for ((family, primitives) in familyPrimitives) { for ((family, primitives) in familyPrimitives) {
if (primitives.isEmpty()) if (primitives.isEmpty())
yield(family to null) yield(family to null)