Skip to content

Merge #[method(...)] and #[method_id(...)] #457

@madsmtm

Description

@madsmtm

Maybe we should reconsider whether it makes sense to keep those to separate? It would make it much easier for the user if they were merged. An argument for keeping them separate is compilation speed, since for #[method_id(...)] we know the we don't need to run the const code to check the selector? Though since we're specifying it anyhow in header-translator, perhaps we can just keep doing that.

EDIT: A quick test shows that getting rid of method families is a fairly big compile time regression. But I think we could still merge these, we can just choose to keep the method families in (and perhaps make it public, something like #[method(abc:def:, family = none)] could be cool).

I'm unsure of how much of an influence the selector checking has, will need to do an experiment to verify.

Note: All of this is easily solved by just checking the syntax tokens, but that is fundamentally brittle, so we should avoid going that route - it should ideally be handled in the type-system!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-objc2Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` cratesenhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions