amethyst / specs

Specs - Parallel ECS
https://amethyst.github.io/specs/
Apache License 2.0
2.49k stars 219 forks source link

Can't use derive macro for Component if specs::Component is used under another name #719

Open interfect opened 3 years ago

interfect commented 3 years ago

The derive macro for components seems to be assuming that the literal string "Component" in my source code is going to point to specs::Component.

https://github.com/amethyst/specs/blob/d4435bdf496cf322c74886ca09dd8795984919b4/specs-derive/src/lib.rs#L72

This isn't true if I have my own Component type and I have done something like use specs::Component as SComponent;. It's also not true if I'm also using another library using similar code that wants ownership of the non-namespaced name Component.

The macro should be changed to use a fully-qualified specs::Component, so it can coexist with Components from other crates.

Or am I doing something very wrong?

WaDelma commented 3 years ago

Fully-qualified specs::Component was removed in https://github.com/amethyst/specs/pull/467. I don't have horse on the race either way just linking to the previous discussion.