Kotlin resolution ambiguity when trying to access a field named "name" in an enum

48 Views Asked by At

Kotlin can't access a field in a java enum because it is called name, which collides with the name variable in Kotlin's definition of Enum, as seen in this question: Conflicting 'name' declaration in enum

The solution to that question was to edit the enum, but I can't edit this Java enum.

How do I resolve the ambiguity for Kotlin so that I can access the name field?

0

There are 0 best solutions below