J-Rojas
04/05/2018, 5:07 PM@SymbolName("Kotlin_Interop_CreateNSArrayFromKList")
private external fun MyCreateNSArrayFromKList(list: List<*>) : NSArray
@SymbolName("Kotlin_Interop_createStablePointer")
private external fun MyCreateStablePointer(any: Any): COpaquePointer
Both of these functions are defined in the K/N runtime.
When I compile, the first one produces this exception:
exception: java.lang.IllegalArgumentException: function Kotlin_Interop_CreateNSArrayFromKList already exists @ ContextUtils.kt:276
The second one, which is also defined in the runtime, produces no exception.
How does SymbolName work? I'm assuming it gives the compiler knowledge of the 'extern C' symbol that it should use for linking, not necessarily a declaration of a new function. The second example proves this hypothesis. So why does the compiler complain about the first function symbol name existing?