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

Inline UITraitChangeObservable in implementing classes #20265

Closed
rolfbjarne opened this issue Mar 6, 2024 · 2 comments · Fixed by #21676
Closed

Inline UITraitChangeObservable in implementing classes #20265

rolfbjarne opened this issue Mar 6, 2024 · 2 comments · Fixed by #21676
Milestone

Comments

@rolfbjarne
Copy link
Member

This is a follow-up to #19410.

We need to inline the members of the UITraitChangeObservable interface into implementing types (UIView, UIViewController, UIPresentationController, UIWindowScene). This turned out a bit cumbersome to implement, because C# doesn't support calling the default interface member from an actual implementing member (#13294 (comment)).

Here's the current WIP: rolfbjarne@5e09575 / https://github.com/rolfbjarne/xamarin-macios/commits/uitraitchangeobservable-inlined-edition

This is probably much easier to do once we've added support for default interface members (#13294), so postpone until then.

@rolfbjarne rolfbjarne added this to the Future milestone Mar 6, 2024
@rolfbjarne rolfbjarne changed the title Inline Inline UITraitChangeObservable in implementing interfaces Mar 6, 2024
@rolfbjarne rolfbjarne changed the title Inline UITraitChangeObservable in implementing interfaces Inline UITraitChangeObservable in implementing classes Mar 6, 2024
@seanrodda
Copy link

@rolfbjarne As #13294 is closed, is this able to be implemented?

@rolfbjarne
Copy link
Member Author

@rolfbjarne As #13294 is closed, is this able to be implemented?

I'll look into it and see what I can do.

rolfbjarne added a commit that referenced this issue Nov 21, 2024
…that implement it. Fixes #20265.

This also required fixing:

* A bug in the static registrar where we'd ignore the generic parameters in a method
  when looking for methods implementing an interface.

* A bug in the generator where we'd throw You_Should_Not_Call_base_In_This_Method()
  in some cases where we shouldn't.

Also:

* Enable nullability and fix any resulting issues.
* Clean up some legacy code we don't need anymore.

Ref: #19410 (comment)

Fixes #20265.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants