Rantanen / intercom

Object based cross-language FFI for Rust
MIT License
63 stars 7 forks source link

Interface types are not gathered in typelib #174

Closed dontpanic92 closed 4 years ago

dontpanic92 commented 4 years ago

In __gather_module_types, interface types are not gathered. As a result, interfaces cannot be exported in IDL when I write

com_library! {
    interface IFoo
}

https://github.com/Rantanen/intercom/blob/f6728c2c6add9f9c42b084359d637e2b4fda407e/intercom-common/src/attributes/com_library.rs#L172-L181

Is that by design? I can get it work by simply adding a create_interface_typeinfo there

Rantanen commented 4 years ago

It's unimplemented.

Back when __gather_module_types was implemented, the com_library didn't support anything but classes and instead the interfaces were gathered from the create_class_typeinfo by figuring out what interfaces the classes implement. I'll add that and ensure there's no issues if an interface is both exported by com_library and also referenced by a class (and exported that way).