Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat structfail.h
- typedef struct some_struct_t {
- int data;
- } some_struct_t;
- some_struct_t make_some_struct() {
- printf("Making struct.\n");
- some_struct_t value;
- value.data = 42;
- return value;
- }
- $ cat structfail.def
- headers = structfail.h
- $ cat structfail_main.kt
- import structfail.*
- fun main(args: Array<String>) {
- println("Hello from Kotlin/Native!")
- make_some_struct()
- println("Called native function.")
- }
- $ cinterop -def ./structfail.def -copt -I. -o structfail.kt.bc
- JetFile: structfail.kt
- $ konanc -library structfail.kt.bc structfail_main.kt
- JetFile: structfail_main.kt
- $ ./program.kexe
- Hello from Kotlin/Native!
- Making struct.
- Uncaught exception from Kotlin's main: Throwable: typeOf() is called with erased argument
- at ./program.kexe() [0x40fccb]
- at ./program.kexe() [0x40ffc1]
- at ./program.kexe() [0x411ec3]
- at ./program.kexe() [0x411e6b]
- at ./program.kexe() [0x41669e]
- at ./program.kexe() [0x417b9e]
- at ./program.kexe() [0x417ab9]
- at ./program.kexe() [0x418a8f]
- at ./program.kexe() [0x411544]
- at ./program.kexe() [0x411455]
- at ./program.kexe() [0x4182ed]
- at ./program.kexe() [0x4113dc]
- at ./program.kexe() [0x409dd3]
- at ./program.kexe() [0x409e29]
- at ./program.kexe(Konan_main+0x5b) [0x4112db]
- at /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f32fbbbcb45]
- at ./program.kexe() [0x409cc8]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement