-
Notifications
You must be signed in to change notification settings - Fork 56
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
[ffigen] Interfaces implement their conformed protocols #1953
Open
liamappelbe
wants to merge
7
commits into
main
Choose a base branch
from
protoconf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,560
−129
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PR HealthBreaking changes ✔️
API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
liamappelbe
changed the title
WIP: [ffigen] Interfaces implement their conformed protocols
[ffigen] Interfaces implement their conformed protocols
Jan 30, 2025
HosseinYousefi
approved these changes
Jan 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One test is failing though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is the first part of #1462. The major change is that all code-genned interface classes now implement all the classes corresponding to the protocols they conform to. The next change will be to start code-genning
id<Foo>
(whereFoo
is a protocol) asFoo
instead ofObjCObjectBase
.The protocol classes aren't changing much, and don't have any non-static members, so there's nothing to actually inherit or implement. The protocol classes are just acting as markers to enforce the upcoming
id<Foo>
changes.For example,
class NSString extends NSObject {
has becomeclass NSString extends NSObject implements NSCopying, NSMutableCopying, NSSecureCoding {
.Details
ObjCProtocol
part of theType
family, instead of just being a typeless binding, which means implementing things like subtyping logic for protocols.abstract interface
instead ofabstract final
, and inherit from a newObjCProtocolBase
class.NSObject
protocol that collides with theNSObject
interface, so I'm renaming it in package:objective_c toNSObjectProtocol
. This means thatObjCBuiltInFunctions.builtInProtocols
needs to support renaming, likebuiltInCompounds
.NSString
declaration has gotten so much longer, the formatter now wants to wrap it in extra_methods.dart, which would break the patching logic in generate_code.dart. I tried a couple of ways of disabling the formatter for this file, but they didn't work, so I renamed it to extra_methods.dart.in.