Remove obsolete experimental coroutines support

in compiler.
This commit is contained in:
Ilmir Usmanov
2021-07-29 08:49:46 +02:00
parent ebb340fe68
commit 486c6b3c15
74 changed files with 349 additions and 1019 deletions
@@ -28,8 +28,6 @@ import org.jetbrains.kotlin.base.kapt3.KaptFlag
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.codegen.coroutines.CONTINUATION_PARAMETER_NAME
import org.jetbrains.kotlin.codegen.needsExperimentalCoroutinesWrapper
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.Annotations
@@ -1022,7 +1020,7 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati
if (sourceElement == null) return@getNonErrorType null
if (sourceElement.hasDeclaredReturnType() && isContinuationParameter(parameterDescriptor)) {
val continuationTypeFqName = getContinuationTypeFqName(descriptor)
val continuationTypeFqName = StandardNames.CONTINUATION_INTERFACE_FQ_NAME
val functionReturnType = sourceElement.typeReference!!.text
KtPsiFactory(kaptContext.project).createType("$continuationTypeFqName<$functionReturnType>")
} else {
@@ -1056,19 +1054,9 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati
val containingCallable = descriptor.containingDeclaration
return containingCallable.valueParameters.lastOrNull() == descriptor
&& descriptor.name == CONTINUATION_PARAMETER_NAME
&& descriptor.source == SourceElement.NO_SOURCE
&& descriptor.type.constructor.declarationDescriptor?.fqNameSafe == getContinuationTypeFqName(containingCallable)
}
private fun getContinuationTypeFqName(descriptor: CallableDescriptor): FqName {
val areCoroutinesReleased = !descriptor.needsExperimentalCoroutinesWrapper()
&& kaptContext.generationState.languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines)
return when (areCoroutinesReleased) {
true -> StandardNames.CONTINUATION_INTERFACE_FQ_NAME_RELEASE
false -> StandardNames.CONTINUATION_INTERFACE_FQ_NAME_EXPERIMENTAL
}
&& descriptor.name == CONTINUATION_PARAMETER_NAME
&& descriptor.source == SourceElement.NO_SOURCE
&& descriptor.type.constructor.declarationDescriptor?.fqNameSafe == StandardNames.CONTINUATION_INTERFACE_FQ_NAME
}
private fun <T : JCExpression?> getNonErrorType(