Add java.lang.Enum ordinal and name accessors to special-cased JVM names

Kotlin represents these as read-only properties with unusual getter names.
This commit is contained in:
Chris Smowton
2022-06-14 17:07:30 +01:00
parent d151bf632c
commit 837bef60fe
4 changed files with 38 additions and 1 deletions

View File

@@ -85,7 +85,11 @@ open class KotlinUsesExtractor(
makeDescription(StandardNames.FqNames.map, "<get-entries>") to "entrySet",
makeDescription(FqName("java.util.Map"), "<get-entries>") to "entrySet",
makeDescription(StandardNames.FqNames.mutableList, "removeAt") to "remove",
makeDescription(FqName("java.util.List"), "removeAt") to "remove"
makeDescription(FqName("java.util.List"), "removeAt") to "remove",
makeDescription(StandardNames.FqNames._enum.toSafe(), "<get-ordinal>") to "ordinal",
makeDescription(FqName("java.lang.Enum"), "<get-ordinal>") to "ordinal",
makeDescription(StandardNames.FqNames._enum.toSafe(), "<get-name>") to "name",
makeDescription(FqName("java.lang.Enum"), "<get-name>") to "name",
)
private val specialFunctionShortNames = specialFunctions.keys.map { it.functionName }.toSet()