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

@@ -0,0 +1 @@
fun usesEnum(e: Enum<*>) = e.ordinal.toString() + e.name

View File

@@ -0,0 +1,27 @@
| addAll |
| addRange |
| allOf |
| asIterator |
| clone |
| compareTo |
| complement |
| complementOf |
| copyOf |
| describeConstable |
| equals |
| finalize |
| getDeclaringClass |
| hasMoreElements |
| hashCode |
| name |
| nextElement |
| noneOf |
| of |
| ordinal |
| range |
| resolveConstantDesc |
| toString |
| typeCheck |
| usesEnum |
| valueOf |
| writeReplace |

View File

@@ -0,0 +1,5 @@
import java
from Method m
where m.getDeclaringType().getName().matches("Enum%")
select m.getName()