Skip to content

Class definition improvements #428

Open
@madsmtm

Description

@madsmtm

List of improvements that would bring us closer to feature-parity with Swift:

  • The ability to safely call superclass methods inside declare_class! (though it's probably not safe to do so outside): Calling super methods safely #455
  • Easier init method declaration: declare_class!: Safer initializers #438
  • Allow calling declared methods directly (e.g. without having to duplicate them in extern_methods!).
  • Automatically generate ivar names.
  • Automatically generate helper-module name.
  • Require protocol implementors to have a certain mutability (e.g. NSWindowDelegate should require IsRetainable, or perhaps even MainThreadOnly).
  • Store data about methods from virtual protocols in a const to allow safety-checking them as well.
  • Allow class methods access to the actual class it was invoked with. Swift solves this with self, could we solve it with an extra argument and perhaps a special attribute on that argument?
  • Allow implementing protocol methods without having to specify the selector.
  • ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-objc2Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions