It looks like when I compile Kotlin/Native code, a...
# kotlin-native
l
It looks like when I compile Kotlin/Native code, any global extension functions don’t get added to the Objective-C header. It seems like it would be possible to have
Copy code
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("FooKt")))
@interface FooKt : FooBase
+ (void) bar:(Baz) receiver
@end
but I don’t see this generated. I do see it if I make my extension function in an object, though.
This is assuming my original Kotlin code in Foo.kt was
Copy code
fun Baz.bar()
l
What is Baz? Kotlin multiplatform has some limitations on extensions on certain types
l
In this case, Baz is a simple data class with no member functions. I have some extension functions. Baz is defined inside of Foo.kt
I just created an object for now that wraps my extension functions. When I have time later, I’ll try out a few different things and see what may be causing it to get exported or not. Do you have any examples of limitations so I know where to start?