[FE] Return Name? instead of List<Name> from getBuiltinFunctionNamesByJvmName
This is much more correct, because we have one to one mapping for special java functions in this case, so using single nullable name instead of list of names makes code more readable
This commit is contained in:
+4
-4
@@ -127,13 +127,13 @@ open class SpecialGenericSignatures {
|
||||
|
||||
val ORIGINAL_SHORT_NAMES: List<Name> = NAME_AND_SIGNATURE_TO_JVM_REPRESENTATION_NAME_MAP.keys.map { it.name }
|
||||
|
||||
val JVM_SHORT_NAME_TO_BUILTIN_SHORT_NAMES_MAP: Map<Name, List<Name>> =
|
||||
val JVM_SHORT_NAME_TO_BUILTIN_SHORT_NAMES_MAP: Map<Name, Name> =
|
||||
NAME_AND_SIGNATURE_TO_JVM_REPRESENTATION_NAME_MAP.entries
|
||||
.map { Pair(it.key.name, it.value) }
|
||||
.groupBy({ it.second }, { it.first })
|
||||
.associateBy({ it.second }, { it.first })
|
||||
|
||||
fun getBuiltinFunctionNamesByJvmName(name: Name): List<Name> =
|
||||
JVM_SHORT_NAME_TO_BUILTIN_SHORT_NAMES_MAP[name] ?: emptyList()
|
||||
fun getBuiltinFunctionNamesByJvmName(name: Name): Name? =
|
||||
JVM_SHORT_NAME_TO_BUILTIN_SHORT_NAMES_MAP[name]
|
||||
|
||||
val Name.sameAsBuiltinMethodWithErasedValueParameters: Boolean
|
||||
get() = this in ERASED_VALUE_PARAMETERS_SHORT_NAMES
|
||||
|
||||
Reference in New Issue
Block a user