Is implementation by delegation not supported on K...
# kotlin-native
b
Is implementation by delegation not supported on K/N? In a multiplatform project,
class ListLike(val list: List<String>) {}
works great, but
class ListLike(val list: List<String>) : List<String> by list {}
does not generate an entry in the iOS framework. However, the javascript modules does create all the delegating methods. Is this a known limitation?
s
Is this a known limitation?
Yes. Some special classes like custom collection implementations aren’t included to framework API.
So this is not related to delegation which is fully supported.
b
Got it - thanks for the quick reply
@svyatoslav.scherbina I think I misunderstood the scope of things earlier - it appears that I can’t even manually implement the methods of List
As soon as my class claims to inherit/implement List<String>, it disappears from the framework
Is there a workaround possible?
s
Consider keeping List subclasses in Kotlin.