reject unsupported tuple components#750
Conversation
ktoso
left a comment
There was a problem hiding this comment.
Hmmm, I see -- we'll have to make those work eventually I think. I'll make an issue, meanwhile this is ok
|
@ktoso yes, I understand that my solutions may be temporary, because your library is very large and complex, and it is difficult to fully understand it right away. I completely understand that later you may replace this with approaches that fit better within the patterns and architecture adopted in the library 🤝 |
|
No problem, thanks a lot for the contribution! Let me know if you need a tagged release, we could do a 0.3.1 at any time |
|
Beyond tuples, most non-primitive types aren't usable in Dictionaries. |
|
@ktoso Thank you for the offer, I can wait until the next full release. For now, I’m using my own branch where I merged all 3 of my PRs, because I really needed these basic fixes to comfortably and lazily develop a cross-platform library with shared logic for iOS and Android applications. At this point, everything I wrote has finally been built into a single cross-platform Swift library together with all dependencies from other dynamic libraries built in Rust and C++. And it successfully runs on Android. The first test flight went well — hopefully everything will continue to be fine :) Thank you for your huge amount of work and for such an interesting approach, which saved me from the enormous effort of writing JNI wrappers manually. You guys are awesome 👍 |
I noticed that jextract allowed multielement swift tuples in places where the JNI bridge later requires a concrete JavaBoxable type. Swift tuples cannot conform to protocols, so the generated code could fail to compile. I fixed it by rejecting unsupported tuple components during translation 🫣