Clean up: rename Jet* to Kt*

This commit is contained in:
Vladimir Dolzhenko
2023-01-03 15:18:45 +01:00
parent d6e587171e
commit 4542b3947b
65 changed files with 179 additions and 177 deletions
@@ -19,17 +19,20 @@ import org.jetbrains.kotlin.types.KotlinType
val KotlinType.nameIfStandardType: Name?
get() = constructor.declarationDescriptor?.takeIf(KotlinBuiltIns::isBuiltIn)?.name
fun KotlinType.getJetTypeFqName(printTypeArguments: Boolean): String {
@Deprecated(message = "Use getKotlinTypeFqName(Boolean) instead")
fun KotlinType.getJetTypeFqName(printTypeArguments: Boolean): String = getKotlinTypeFqName(printTypeArguments)
fun KotlinType.getKotlinTypeFqName(printTypeArguments: Boolean): String {
val declaration = requireNotNull(constructor.declarationDescriptor) {
"declarationDescriptor is null for constructor = $constructor with ${constructor.javaClass}"
}
if (declaration is TypeParameterDescriptor) {
return StringUtil.join(declaration.upperBounds, { type -> type.getJetTypeFqName(printTypeArguments) }, "&")
return StringUtil.join(declaration.upperBounds, { type -> type.getKotlinTypeFqName(printTypeArguments) }, "&")
}
val typeArguments = arguments
val typeArgumentsAsString = if (printTypeArguments && !typeArguments.isEmpty()) {
val joinedTypeArguments = StringUtil.join(typeArguments, { projection -> projection.type.getJetTypeFqName(false) }, ", ")
val joinedTypeArguments = StringUtil.join(typeArguments, { projection -> projection.type.getKotlinTypeFqName(false) }, ", ")
"<$joinedTypeArguments>"
}
@@ -237,7 +237,7 @@ public final class PatternBuilder {
if (actualReceiver != null) {
if (receiverFqName == null) return false;
String actualReceiverFqName = DescriptorUtilsKt.getJetTypeFqName(actualReceiver.getType(), false);
String actualReceiverFqName = DescriptorUtilsKt.getKotlinTypeFqName(actualReceiver.getType(), false);
if (!actualReceiverFqName.equals(receiverFqName)) return false;
}