Skip to content

Adding a method isn't ergonomic #12

Description

@SSheldon

Adding a method to a ClassDecl isn't ergonomic because you need to cast the function to a function pointer, like so:

add_method(sel!(setFoo:), my_obj_set_foo as extern fn(&mut Object, Sel, u32))

This is a bummer because you need to repeat the types that you've already specified.

This wasn't always the case for Rust, but this behavior changed in rust-lang/rust#19891. rust-lang/rust#21086 was opened about this, but was closed as expected behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions