Move some common parts from BuiltinMethodsWithDifferentJvmName to SpecialGenericSignatures

This commit is contained in:
Denis.Zharkov
2021-02-17 14:51:08 +03:00
parent 5d5228cfc5
commit 893b1045ba
5 changed files with 16 additions and 11 deletions
@@ -26,6 +26,9 @@ object BuiltinSpecialProperties {
PROPERTY_FQ_NAME_TO_JVM_GETTER_NAME_MAP.entries
.map { Pair(it.key.shortName(), it.value) }
.groupBy({ it.second }, { it.first })
.mapValues {
it.value.distinct()
}
val SPECIAL_FQ_NAMES: Set<FqName> = PROPERTY_FQ_NAME_TO_JVM_GETTER_NAME_MAP.keys
val SPECIAL_SHORT_NAMES: Set<Name> = SPECIAL_FQ_NAMES.map(FqName::shortName).toSet()
@@ -132,5 +132,14 @@ open class SpecialGenericSignatures {
.map { Pair(it.key.name, it.value) }
.groupBy({ it.second }, { it.first })
fun getBuiltinFunctionNamesByJvmName(name: Name): List<Name> =
JVM_SHORT_NAME_TO_BUILTIN_SHORT_NAMES_MAP[name] ?: emptyList()
val Name.sameAsBuiltinMethodWithErasedValueParameters: Boolean
get() = this in ERASED_VALUE_PARAMETERS_SHORT_NAMES
val Name.sameAsRenamedInJvmBuiltin: Boolean
get() = this in ORIGINAL_SHORT_NAMES
}
}
}