-
Notifications
You must be signed in to change notification settings - Fork 83
[ffigen] Migrate to extension types #2723
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
base: main
Are you sure you want to change the base?
Conversation
PR HealthBreaking changes ✔️
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with
API leaks
|
| Package | Leaked API symbol | Leaking sources |
|---|---|---|
| objective_c | _FinalizablePointer | internal.dart::_ObjCReference::new::_finalizable |
This check can be disabled by tagging the PR with skip-leaking-check.
License Headers ⚠️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
| Files |
|---|
| pkgs/objective_c/lib/src/ns_input_stream.dart |
All source files should start with a license header.
This check can be disabled by tagging the PR with skip-license-check.
|
|
||
| expect(objectRetainCount(obj1raw), 1); | ||
| expect(objectRetainCount(obj2raw), 1); | ||
| expect(objectRetainCount(obj1raw), greaterThan(0)); |
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.
Why are we changing these to a generic greaterThan(0)? The tests are now weaker as a result?
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.
Every now and then I have to switch one of these tests from a number to greaterThan(0) because of some CI flakiness (sometimes the exact number is different on different machines, or different runs on the same machine). Then with this extension type change we're holding fewer total references from Dart to ObjC, so I was going to have to change a bunch of the numbers to new values, or to greaterThan(0). Ultimately we don't really care about the specific number of references, just whether there's 0 or more than 0 references. So I figured it would be better to just switch them all to greaterThan(0), rather than going through and changing all the numbers, only to later switch some of them to greaterThan(0) when the specific number varies on CI.
Before
After
Other changes
package:objective_c's collections can no longer directly implement the corresponding Dart collection. So I had to split out the Darty helpers into separate adapter classes.isInstance->isAcastFrom->ascastFromPointer->fromPointerObjCObject->ObjCObjectImplObjCProtocol->ObjCProtocolImplObjCObjectBase->ObjCObjectObjCProtocolBase->ObjCProtocolFixes #2664