-
Notifications
You must be signed in to change notification settings - Fork 507
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
[bgen] Implement support for using default interface members to bind protocols. #20681
Merged
Commits on Jun 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f95f903 - Browse repository at this point
Copy the full SHA f95f903View commit details -
Configuration menu - View commit details
-
Copy full SHA for 151c107 - Browse repository at this point
Copy the full SHA 151c107View commit details -
Configuration menu - View commit details
-
Copy full SHA for d72619a - Browse repository at this point
Copy the full SHA d72619aView commit details -
[bgen] Fix rendering types needing global qualifier depending on loca…
…tion by fixing location.
Configuration menu - View commit details
-
Copy full SHA for 3ea1348 - Browse repository at this point
Copy the full SHA 3ea1348View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b76386 - Browse repository at this point
Copy the full SHA 7b76386View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4f4382 - Browse repository at this point
Copy the full SHA d4f4382View commit details -
[bgen] Implement support for using default interface members to bind …
…protocols. Given the following API definition: ```cs [Protocol] public interface Protocol { [Abstract] [Export ("requiredMethod")] void RequiredMethod (); [Export ("optionalMethod")] void OptionalMethod (); } ``` we're now binding it like this: ```cs [Protocol ("Protocol")] public interface IProtocol : INativeObject { [RequiredMember] [Export ("requiredMethod")] public void RequiredMethod () { /* default implementation */ } [OptionalMember] [Export ("optionalMethod")] public void OptionalMethod () { /* default implementation */ } } ``` The main difference from before is that the only difference between required and optional members is the [RequiredMember]/[OptionalMember] attributes. This has one major advantage: it's now possible to switch a member from being required to being optional, or vice versa, without breaking neither source nor binary compatibility. It also improves intellisense for optional members. In the past optional members were implemented using extension methods, which were not very discoverable when you were supposed to implement a protocol in your own class. The main downside is that the C# compiler won't enforce developers to implement required protocol members (which is a necessary side effect of the fact that we want to be able to switch members between being required and optional without breaking compatibility). If this turns out to be a problem, we can implement a custom source analyzer and/or linker step that detects missing implementations and issue warnings/errors. Also: * Add numerous tests. * Add documentation. * Handle numerous corner cases, which are documented in code and docs. Fixes xamarin#13294.
Configuration menu - View commit details
-
Copy full SHA for 8390f51 - Browse repository at this point
Copy the full SHA 8390f51View commit details -
Configuration menu - View commit details
-
Copy full SHA for 437176c - Browse repository at this point
Copy the full SHA 437176cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a948d9 - Browse repository at this point
Copy the full SHA 2a948d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e8df9c - Browse repository at this point
Copy the full SHA 4e8df9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae939ca - Browse repository at this point
Copy the full SHA ae939caView commit details
Commits on Jun 5, 2024
-
1
Configuration menu - View commit details
-
Copy full SHA for 3d35ded - Browse repository at this point
Copy the full SHA 3d35dedView commit details
Commits on Jun 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4417249 - Browse repository at this point
Copy the full SHA 4417249View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e3c521 - Browse repository at this point
Copy the full SHA 1e3c521View commit details -
Configuration menu - View commit details
-
Copy full SHA for de28527 - Browse repository at this point
Copy the full SHA de28527View commit details -
1
Configuration menu - View commit details
-
Copy full SHA for 247b7d6 - Browse repository at this point
Copy the full SHA 247b7d6View commit details -
1
Configuration menu - View commit details
-
Copy full SHA for dc0e7aa - Browse repository at this point
Copy the full SHA dc0e7aaView commit details
Commits on Jun 7, 2024
-
3
Configuration menu - View commit details
-
Copy full SHA for eed33cb - Browse repository at this point
Copy the full SHA eed33cbView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.