Skip to content

Adding a method isn't ergonomic #12

Open
@SSheldon

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.

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