One last question: does Kotlin Native support exte...
# kotlin-native
j
One last question: does Kotlin Native support extension methods? I've got this bit of hackery:
Copy code
fun Byte.xor(v: Byte): Byte = ((this.toInt() and 0xFF) xor (v.toInt() and 0xFF)).toByte()
and I'm seeing
Copy code
api8610509288099049914.cpp:39:25: error: expected member name or ';' after declaration specifiers
      cpu_x1_KByte (*xor)(cpu_x1_KByte thiz, cpu_x1_KByte v);
g
Yes, of course, supports. But not sure why do you get this error. Probably you should report an issue https://github.com/JetBrains/kotlin-native/issues
j
Will do. Thanks.
o
xor is C keyword, use some other name , i.e. eor
g
So it means that some Kotlin code can not be compiled to Kotlin native. Should K/N have @JvmName analogue for such cases?
o
It has nothing to with K/N itself. It is only C bindings affected. Annotation may make sense although
g
Yes, I understand, of course it’s C, same way as Kotlin JVM allows reserved Java keywords
BTW, should I create feature request about
@JvmName
like annotation for K/N?