Move static constants with builtin names to :core:descriptors.common module

This commit is contained in:
Dmitriy Novozhilov
2020-08-16 22:57:12 +03:00
parent 2e92fe9be9
commit 7a7fe77b8e
180 changed files with 1085 additions and 1025 deletions
@@ -5,9 +5,9 @@
package org.jetbrains.kotlin.config
import org.jetbrains.kotlin.builtins.KotlinBuiltInsNames
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorUtils
fun LanguageVersionSettings.coroutinesPackageFqName(): FqName {
return coroutinesPackageFqName(isReleaseCoroutines())
@@ -17,9 +17,9 @@ fun LanguageVersionSettings.isReleaseCoroutines() = supportsFeature(LanguageFeat
private fun coroutinesPackageFqName(isReleaseCoroutines: Boolean): FqName {
return if (isReleaseCoroutines)
DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_RELEASE
KotlinBuiltInsNames.COROUTINES_PACKAGE_FQ_NAME_RELEASE
else
DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL
KotlinBuiltInsNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL
}
fun LanguageVersionSettings.coroutinesIntrinsicsPackageFqName() =
@@ -33,7 +33,7 @@ fun LanguageVersionSettings.restrictsSuspensionFqName() =
fun FqName.isBuiltInCoroutineContext(languageVersionSettings: LanguageVersionSettings) =
if (languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines))
this == DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_RELEASE.child(Name.identifier("coroutineContext"))
this == KotlinBuiltInsNames.COROUTINES_PACKAGE_FQ_NAME_RELEASE.child(Name.identifier("coroutineContext"))
else
this == DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.child(Name.identifier("coroutineContext")) ||
this == DescriptorUtils.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME_EXPERIMENTAL.child(Name.identifier("coroutineContext"))
this == KotlinBuiltInsNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.child(Name.identifier("coroutineContext")) ||
this == KotlinBuiltInsNames.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME_EXPERIMENTAL.child(Name.identifier("coroutineContext"))