-
Notifications
You must be signed in to change notification settings - Fork 511
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
[docs] Add design doc about how we're improving our generator support in .NET 9. #16293
Conversation
Don't merge until we're branching for |
I think the "Coping with C# quirks" section covers the nonsense I ran into, and "inlining" versions that cast to base is the best solution. I'm wondering however, would that work if you are a customer and have a derived class?
|
@chamons I'm not quite sure I understand your example. If your custom class implements the interface, then no, it wouldn't work: public interface IProtocol {
public void DoSomething () {}
}
public class MyWindow : UIWindow, IProtocol {
public void Hello ()
{
this.DoSomething (); // this doesn't work
((IProtocol) this).DoSomething (); // this works
}
}
public class MyWindow2 : UIWindow, IProtocol {
public void Hello ()
{
this.DoSomething (); // this works now, it calls the method below
}
public void DoSomething ()
{
((IProtocol) this).DoSomething ();
}
} |
I was wondering out loud about this: Our Binding
User Code
And I think that'd work. |
@chamons yes, that should work |
Superseded by #20681. |
This is a proposal for how to improve our generator support for protocols using C#'s default interface member and static interface member features.
Comments, ideas, etc. are welcome!
For an initial review it might be easier to read the rendered document: https://github.com/rolfbjarne/xamarin-macios/blob/net8.0-dim/docs/objective-c-protocols.md
Fixes #13294.