Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class declaration improvements #428

Open
4 of 9 tasks
madsmtm opened this issue Mar 2, 2023 · 0 comments
Open
4 of 9 tasks

Class declaration improvements #428

madsmtm opened this issue Mar 2, 2023 · 0 comments
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates

Comments

@madsmtm
Copy link
Owner

madsmtm commented Mar 2, 2023

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?
  • ...
@madsmtm madsmtm added the A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates label Mar 2, 2023
@madsmtm madsmtm added this to the icrate v0.2.0 milestone Mar 2, 2023
@madsmtm madsmtm modified the milestones: Polish icrate, Usable icrate Sep 5, 2023
@madsmtm madsmtm modified the milestones: Usable icrate, Polish icrate Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates
Projects
None yet
Development

No branches or pull requests

1 participant