is there a way other than going down with annotati...
# announcements
e
is there a way other than going down with annotation and code generation?
d
Had similar problem. You could make all the companion objects implement a common interface or base class. Then declare the extension function on the interface.
e
but the problem is referring to
names
from the extension function
d
The interface will declare a
val names: IntBuffer
, which you can then access.
Oh I think I understand now, you want to declare the extension function on the enum entries?
e
exactly
d
Copy code
interface Whatever { val names: IntBuffer }
enum class Buffer : Whatever {
 VERTEX, ELEMENT;
 companion object { val names: IntBuffer }
override val names: IntBuffer get() = Companion.names
}
inline fun Whatever.bind(..) {
   // do something on names
}
e
nice