Skip to content

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

@interfect

Description

@interfect

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.

impl #impl_generics Component for #name #ty_generics #where_clause {

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions