Deserialize experimental coroutines as suspend functions/types

but deprecate them for now.
Promote stub version.
 #KT-25623: Fixed
This commit is contained in:
Ilmir Usmanov
2018-07-19 21:49:28 +03:00
parent 88a5eb24d5
commit fa9653c3d2
16 changed files with 228 additions and 127 deletions
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.serialization
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.builtins.isSuspendFunctionType
import org.jetbrains.kotlin.builtins.isSuspendFunctionTypeOrSubtype
import org.jetbrains.kotlin.builtins.transformSuspendFunctionToRuntimeFunctionType
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.descriptors.*
@@ -355,8 +356,9 @@ class DescriptorSerializer private constructor(
return listOfNotNull(
extensionReceiverParameter?.type,
returnType,
*typeParameters.flatMap { it.upperBounds }.toTypedArray(),
*valueParameters.map(ValueParameterDescriptor::getType).toTypedArray()
).any { type -> type.contains(UnwrappedType::isSuspendFunctionType) }
).any { type -> type.contains(UnwrappedType::isSuspendFunctionTypeOrSubtype) }
}
fun typeAliasProto(descriptor: TypeAliasDescriptor): ProtoBuf.TypeAlias.Builder {