Skip to content

Confusing error when #[getset(get_copy = "pub")] is specified but not derive(CopyGetters) #67

@Boscop

Description

@Boscop

When #[getset(get_copy = "pub")] is specified but CopyGetters is not derived (only Getters), the proc-macro doesn't give an error, instead rustc gives the error that foo.bar() is not a method but a field.

Solution: The proc-macro could give an error. But I'd prefer another solution:
Remove CopyGetters altogether, only have Getters, such that get_copy works when Getters is derived. This makes much more sense IMO.
Or is there a reason to require the user to derive CopyGetters / any disadvantages when get_copy is also allowed with Getters?
To me it seems to be more verbose / requiring more typing than necessary, and I often forget to derive CopyGetters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions