So... I'm not sure if this is a bug or something I...
# kotlin-native
t
So... I'm not sure if this is a bug or something I just don't understand. I'm calling a function that returns a struct, which means a CValue<something>. It compiles fine, but at runtime I get: "Uncaught exception from Kotlin's main: Throwable: typeOf() is called with erased argument". What's going on?
o
Henrik, could you post your minimal example on pastebin or here?
t
Here is a minimal example: https://pastebin.com/5p2KnQxm The actual thing I was trying to do was to call xcb_setup_roots_iterator in the XCB library.
It looks like the readValue() call on the some_struct_t instance is what's failing.
o
your issue shall be fixed by https://github.com/JetBrains/kotlin-native/pull/463, guess it will be merged today
t
Yay! 😁 Thanks for that. Now the XCB example code is working, although with lots of "warning: failed to obtain inline function declaration" everywhere. (And compiling the compiler from source was quite painless – less than 3 minutes.)
o
yes, this warning will go away soon