do extension functions work the same on enums as on other classes?
JasonB
04/20/2023, 10:05 PM
as in, I expect to be able to define:
Copy code
enum class A {
ONE,
TWO
}
fun A?.transform() {
}
JasonB
04/20/2023, 10:06 PM
but I cannot seem to be able to call
transform()
on an instance of enum
A
JasonB
04/20/2023, 10:20 PM
ok, figured out the problem - had defined the extension function next to the enum but still inside the parent class, so Kotlin didn't export the function as I expected