I have a Java enum similar to this one:
package com.example;
public enum FaultType {
A("process"), B("electrical");
public final String name;
FaultType(String name) {
this.name = name;
}
}
The problematic thing is the public final field name
.
If I access a field of this type from Kotlin
package com.example
class FaultUser(val faultType: FaultType) {
fun show() = faultType.name
}
… IntelliJ shows the error:
Overload resultion ambiguity. All these functions match.
Tested with Kotlin 1.2.41 and IntelliJ 2018.1.2.
Is this a bug? Or do I have to do something special in Kotlin to access this field?