Minor, remove obsolete coroutines-related code from mapBuiltInType

This commit is contained in:
Alexander Udalov
2019-06-21 19:48:02 +02:00
parent 10d1adca03
commit edce35a643
2 changed files with 5 additions and 19 deletions
@@ -5,14 +5,14 @@
package org.jetbrains.kotlin.load.kotlin
import org.jetbrains.kotlin.builtins.*
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.builtins.isSuspendFunctionType
import org.jetbrains.kotlin.builtins.jvm.JavaToKotlinClassMap
import org.jetbrains.kotlin.builtins.transformSuspendFunctionToRuntimeFunctionType
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.load.java.typeEnhancement.hasEnhancedNullability
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
@@ -205,13 +205,6 @@ fun hasVoidReturnType(descriptor: CallableDescriptor): Boolean {
&& descriptor !is PropertyGetterDescriptor
}
private fun continuationInternalName(releaseCoroutines: Boolean): String {
val fqName =
if (releaseCoroutines) DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME_RELEASE
else DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME_EXPERIMENTAL
return JvmClassName.byClassId(ClassId.topLevel(fqName)).internalName
}
private fun <T : Any> mapBuiltInType(
type: KotlinType,
typeFactory: JvmTypeFactory<T>,
@@ -219,12 +212,6 @@ private fun <T : Any> mapBuiltInType(
): T? {
val descriptor = type.constructor.declarationDescriptor as? ClassDescriptor ?: return null
if (descriptor === FAKE_CONTINUATION_CLASS_DESCRIPTOR_EXPERIMENTAL) {
return typeFactory.createObjectType(continuationInternalName(false))
} else if (descriptor == FAKE_CONTINUATION_CLASS_DESCRIPTOR_RELEASE) {
return typeFactory.createObjectType(continuationInternalName(true))
}
val primitiveType = KotlinBuiltIns.getPrimitiveType(descriptor)
if (primitiveType != null) {
val jvmType = typeFactory.createFromString(JvmPrimitiveType.get(primitiveType).desc)