Repository navigation
Support interfaces deriving from external traits (fixes #2430) - #2616
Conversation
bendk
left a comment
There was a problem hiding this comment.
This seems good to me. I had one concern about the module name, but I'm fine with merging this now and figuring that out later.
| root.visit(|m: &Module| { | ||
| m.visit(|int: &Interface| { | ||
| if matches!(int.imp, ObjectImpl::Trait | ObjectImpl::CallbackTrait) { | ||
| known_traits.insert(int.name.clone(), m.name.to_owned()); |
There was a problem hiding this comment.
It seems like this would fail if 2 modules defined traits with the same name.
I think that's okay for now, since we can't really do anything better. But what do you think about eventually adding a trait_module field in the metadata? I guess this would do what tr_module_name was trying to do before.
There was a problem hiding this comment.
It seems like this would fail if 2 modules defined traits with the same name.
yeah, I didn't think about that! So I made it fallible and made the restriction a little more obvious. It made me think too that it should be focused more on this specific issue, so renamed 'missing_typestotrait_types`.
But what do you think about eventually adding a trait_module field in the metadata? I guess this would do what tr_module_name was trying to do before.
Yeah, but I don't see a path to capturing that in the macros - certainly not the name, hence killing tr_module_name. I tried to use TYPE_ID_META but things went sideways due to the trait and I failed to work that out. It would be great if we could capture more metadata though and this could go away.
9ffb30f to
4e08248
Compare
No description provided.