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
but I don’t see this generated. I do see it if I make my extension function in an object, though.
Landry Norris
12/05/2022, 3:15 PM
This is assuming my original Kotlin code in Foo.kt was
Copy code
fun Baz.bar()
l
leandro
12/05/2022, 10:28 PM
What is Baz? Kotlin multiplatform has some limitations on extensions on certain types
l
Landry Norris
12/05/2022, 10:36 PM
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
Landry Norris
12/05/2022, 10:37 PM
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?