https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
b

bod

12/20/2019, 3:07 PM
Well, I've made my
Page<T>
a class instead of an interface, and it still doesn't work. Ideas?
k

kpgalligan

12/20/2019, 4:20 PM
Any way you can post a sample? I wrote the original generics support. I haven’t looked at it in a while, but I would expect
Page
to support generics if it’s a class. What does the generated header look like?
b

bod

12/20/2019, 4:52 PM
Thanks for replying! Well actually I found a workaround, by making
Page<T: Any>
instead of
Page<T>
it started to work as expected. I thought this would fix nullability but it also fixed the generics.
I can revert to the previous state if you want to investigate it
k

kpgalligan

12/20/2019, 4:54 PM
Hmm. OK. Interesting that the type bounds fixes it. That should probably be a bug, but there were a lot of little corner cases in there
b

bod

12/20/2019, 4:57 PM
to be honest we're investigating if Kotlin MP would be a good solution for us to have one shared "api client" library - but the more we dig the more we feel the "experimental" side of it 😛
k

kpgalligan

12/20/2019, 4:58 PM
Well, there’s a blended strategy you can use as well. You can write Swift extensions where useful, that kind of thing. The generics is limited by Objc, not Kotlin or Kotlin Native
Direct swift interop is generally desired, but won’t necessarily make everything better. Lack of value types, etc. No variance on generics. They’re all different languages that are trying to interop, but some limitations are difficult to avoid
👍 1