[swift2objc] feat: Generate implicit constructors for Swift structs#2940
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
There was a problem hiding this comment.
Overall this looks pretty good. Can you add an integration test? Also, make sure to format and analyze your code before you upload, otherwise the github CI won't get very far (and I have to approve each run).
pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart
Outdated
Show resolved
Hide resolved
pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart
Outdated
Show resolved
Hide resolved
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 License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with 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.
This check can be disabled by tagging the PR with |
Thanks for the review and the helpful feedback |
effab91 to
8eb70f1
Compare
liamappelbe
left a comment
There was a problem hiding this comment.
Looks good. I'll approve once the tests pass. I think since you changed the code gen, some of the other integration tests were affected, so you can just regenerate their expected output using dart test/integration/integration_test.dart --regen
|
EDIT: Nevermind. It's not going to work. I was able to hack around the initial build issues, but then I started getting this message: |
|
@liamappelbe |
Not sure what you mean. 3 tests were failing. I said you just need to regenerate the expected bindings ( Please re-add the integration test you deleted and regenerate the bindings for the failing tests. |
I misunderstood the testing process, so I ended up deleting those test files. Sorry about this misunderstanding. I wanted to kindly ask for confirmation, is it correct that these files should be generated by running the --regen command on macOS, rather than being created manually? |
The input file should be written manually. The output file should be generated by the As far as I know, the regen command only works on macOS. Do you have access to a mac device? If not, you can take a look at the github bot logs for the failing tests, since that prints the expected output vs the actual output (like in the screenshot below). Alternatively, if that's too difficult, I can try regenerating the outputs on my mac.
|
I don’t currently have access to a macOS device. I tried running |
I reviewed the GitHub bot logs for the failing tests, compared the expected and actual outputs, and updated the generated output based on that. I’ve pushed a commit reflecting these changes. |
| } | ||
| final storedProperties = originalCompound.properties | ||
| .where((prop) => prop.hasSetter && !prop.isStatic) | ||
| .toList(); |
There was a problem hiding this comment.
@Hassnaa9 After your upload the tests were still failing, so I tried regenerating them for your and they're still failing. I think this line is the culprit. Symbols in the symbol graph are not stored in any particular order. In fact the order varies between runs. So something you'll notice elsewhere in this file (and all the transformers) is a bunch of ..sort( calls, that sort the declarations by ID. You should do the same thing here. The integration tests are currently failing because the properties appear in a different order each time.
Btw, you might want to sync to head before you do that, because I recently added a util that simplifies that sort call, and you'll see those other ..sort( calls in this file change to the new util.
There was a problem hiding this comment.
Done, Thanks for catching that!
037a899 to
8796b87
Compare
44814a8 to
efc5ad3
Compare
44814a8 to
efc5ad3
Compare
44814a8 to
bb07e5e
Compare
bb07e5e to
34f150f
Compare
Hi @liamappelbe The Solution:
failure 2: Including Computed Properties The Root Cause: The Solution:
All integration tests now pass (with 1 unrelated Linux/URLRequest failure). Let me know if you'd like any clarifications or enhancements |
|
Please don't force push unless you absolutely need to (I think I've had to force push once in the last 5 years). It deletes the commit history which makes your PR way harder to review. |
liamappelbe
left a comment
There was a problem hiding this comment.
Looks good. Almost there!
pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart
Outdated
Show resolved
Hide resolved
pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart
Outdated
Show resolved
Hide resolved
pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart
Outdated
Show resolved
Hide resolved
I am awfully sorry, I force pushed because I rebased to clean up some commits, which rewrote the branch history |
liamappelbe
left a comment
There was a problem hiding this comment.
Looks good. Great work.
|
@Hassnaa9 if you want more stuff to work on while I'm away, the list of high priority bugs for swift2objc is here: https://github.com/dart-lang/native/milestone/32 |
commit 931267e Author: Sigurd Meldgaard <sigurdm@google.com> Date: Fri Mar 13 12:26:14 2026 +0100 [infra] Replace pub run with dart run (dart-lang#3000) Co-authored-by: Parker Lougheed <parlough@gmail.com> commit ac1144e Author: Daco Harkes <dacoharkes@google.com> Date: Fri Mar 13 02:11:24 2026 -0700 [record_use] Large ints (dart-lang#3227) Bug: * dart-lang#3220 commit 5cc737d Author: Daco Harkes <dacoharkes@google.com> Date: Fri Mar 13 00:57:31 2026 -0700 [record_use] Double constants (dart-lang#3226) commit d61b82a Author: Liam Appelbe <liama@google.com> Date: Thu Mar 12 12:59:43 2026 +1100 [jnigen] Class bindings implement all super interfaces (dart-lang#3201) commit c478dfe Author: Daco Harkes <dacoharkes@google.com> Date: Wed Mar 11 01:06:15 2026 -0700 [record_use] Canonicalize and sort references (dart-lang#3216) Deduplicates identical references from the same loading unit. Also sorts the references. Closes: * dart-lang#3092 AI transparency: * Generated with Gemini CLI. Architecture mine. Implementation AI. Iterated on with follow up prompts. Code has been reviewed by me. commit ebcfec5 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Mar 11 00:51:37 2026 -0700 [record_use] Change references to have a single loading unit (dart-lang#3215) commit 4fd6bc1 Author: James Williams <66931+jwill@users.noreply.github.com> Date: Sun Mar 8 16:17:30 2026 -0700 [jnigen] Fix manual download - Integrate source download into temporary gradle script (dart-lang#3039) commit d3978d3 Author: Liam Appelbe <liama@google.com> Date: Mon Mar 9 08:51:21 2026 +1100 [swiftgen] Add integration test for async protocol methods (dart-lang#3191) commit 824ab62 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Mar 6 03:19:05 2026 -0800 [infra] Release record_use, hooks, hooks_runner, and native_toolchain_c (dart-lang#3202) commit dc51a9d Author: Daco Harkes <dacoharkes@google.com> Date: Fri Mar 6 00:16:29 2026 -0800 [infra] Add `native_toolchain_ninja` to external packages (dart-lang#3205) commit c503ded Author: Daco Harkes <dacoharkes@google.com> Date: Fri Mar 6 00:16:16 2026 -0800 [record_use] Library documentation (dart-lang#3204) commit 1c94455 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Mar 6 00:14:03 2026 -0800 [infra] Only run formatting on dev (dart-lang#3203) commit bc1b32f Author: Gurleen Kaur <174241618+Gurleen-kansray@users.noreply.github.com> Date: Thu Mar 5 08:07:41 2026 +0530 [ffigen] Move tmpDir into Context and use spaces in temp directory names (dart-lang#3029) commit f208cfc Author: Liam Appelbe <liama@google.com> Date: Thu Mar 5 13:31:29 2026 +1100 [jni] Support custom exceptions (dart-lang#3190) commit f2faed2 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Mar 4 09:56:25 2026 -0800 [record_use] Document what is supported (dart-lang#3197) Add some doc-comments about what language features are supported and what is recorded. This is not the final API yet, but this gives our doc comments a starting point. (Also, not all things have landed yet in the SDK, these docs are written as if they were.) commit 6b1d651 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Mar 4 06:09:44 2026 -0800 [infra] Revert "Disable Coveralls" (dart-lang#3195) This reverts commit 9c94314. They are back up: https://status.coveralls.io/ Closes: dart-lang#3177 commit 31e70be Author: Daco Harkes <dacoharkes@google.com> Date: Wed Mar 4 06:04:53 2026 -0800 [record_use] Remove record_use_internal.dart (dart-lang#3194) commit ebb766b Author: Daco Harkes <dacoharkes@google.com> Date: Wed Mar 4 06:01:06 2026 -0800 [infra] Disable non-working copyright health check (dart-lang#3196) Until dart-lang#3148 is addressed by @mosuem, lets reduce the noise. commit fa77bf7 Author: Liam Appelbe <liama@google.com> Date: Tue Mar 3 11:02:42 2026 +1100 [jnigen] Extension types (dart-lang#3093) commit 269d65c Author: Hassnaa Mohamed <mhassna727@gmail.com> Date: Tue Mar 3 01:47:37 2026 +0200 [swift2objc] feat:support swift tuples(return types) (dart-lang#3158) commit 4a40b82 Author: Daco Harkes <dacoharkes@google.com> Date: Mon Mar 2 04:27:10 2026 -0800 [native_toolchain_c] Run less tests (dart-lang#3183) commit be75c54 Author: Daco Harkes <dacoharkes@google.com> Date: Mon Mar 2 02:01:16 2026 -0800 [hooks_runner] Use dot shorthands (dart-lang#3179) commit 9d488f6 Author: Daco Harkes <dacoharkes@google.com> Date: Mon Mar 2 01:43:19 2026 -0800 [hooks] Use dot shorthands (dart-lang#3176) commit 205afff Author: Liam Appelbe <liama@google.com> Date: Mon Mar 2 11:34:20 2026 +1100 [swift2objc] Fix nesting bugs (dart-lang#3173) commit 77d80f4 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 27 03:45:30 2026 -0800 [native_toolchain_c] Apply dot shorthands (dart-lang#3165) commit b2ec0d5 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 27 03:44:33 2026 -0800 [infra] Agent skill: Apply dot shorthands (dart-lang#3164) commit ae6ca24 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 27 03:44:06 2026 -0800 [record_use] Use dot shorthands (dart-lang#3171) commit 9c94314 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 27 02:27:03 2026 -0800 [infra] Disable Coveralls (dart-lang#3178) commit 4e1412b Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 26 07:25:58 2026 -0800 [record_use] Constructor definitions (dart-lang#3170) commit dd59094 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 26 07:24:49 2026 -0800 [hooks_runner] Automatically add recorded uses to hook dependencies (dart-lang#3169) commit dbcba1d Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 26 07:23:02 2026 -0800 [record_use] Filter out nested constants from other packages (dart-lang#3167) commit 754c69d Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 26 03:50:30 2026 -0800 [infra] Bump Dart API tool (dart-lang#3163) commit 4c3db5f Author: Nourhan H. <109472010+TheNourhan@users.noreply.github.com> Date: Thu Feb 26 12:41:05 2026 +0300 [swift2objc] fix: support optional primitives by boxing as wrapper types (dart-lang#3140) commit 6bf102a Author: Cairo09 <160388974+Cairo09@users.noreply.github.com> Date: Thu Feb 26 04:38:53 2026 +0530 [ffigen] Added allocate constructor for native C structs (dart-lang#3097) commit 173690d Author: Liam Appelbe <liama@google.com> Date: Thu Feb 26 06:40:38 2026 +0800 [infra] Try AI suggested fix for flaky iOS install (dart-lang#3153) commit 8c3f3ec Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 25 05:04:29 2026 -0800 [record_use] Deterministic serialization order (dart-lang#3156) commit 4224cf5 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 25 04:40:20 2026 -0800 [record_use] Canonicalize before serialization (dart-lang#3155) commit 3af7688 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 25 03:35:30 2026 -0800 [record_use] `Constant`s `_depth` and `_size` (dart-lang#3154) commit 512fefc Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 25 03:23:15 2026 -0800 [record_use] Enum constant instances (dart-lang#3151) commit 9eae830 Author: Liam Appelbe <liama@google.com> Date: Wed Feb 25 17:33:25 2026 +0800 [ffigen] Update docs about ObjC runtime types (dart-lang#3152) commit aebbcec Author: Cairo09 <160388974+Cairo09@users.noreply.github.com> Date: Wed Feb 25 07:55:15 2026 +0530 [swift2objc] Inout params support (dart-lang#3132) commit 592e429 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 24 11:19:08 2026 -0800 [record_use] Cache hash codes in Expando instances (dart-lang#3150) For dart-lang#3115, we want to store the depth of constant objects in an `Expando`, to avoid exponential runtime in deep constants. We already use hashmaps/hashsets on constants, and computing the hashCode is currently already recursing. To make computing the hashcode of a large `Recordings` linear, cache the `hashCode`s in an `Expando`. See the recommendation of this pattern in: * dart-lang/language#2225 commit 4cbd204 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 24 10:23:49 2026 -0800 [record_use] Public API deal with non-const (dart-lang#3147) This is not the final API yet, but the current internal API addresses some issues with the public API. So lets remove the old public API. Closes: * dart-lang#2718 * dart-lang#2938 The main design approach of using the new API, deep destructuring in a switch, and giving an error that you cannot tree-shake on failing to destructure: ```dart switch (call) { case CallWithArguments( positionalArguments: [StringConstant(value: final english), ...], ): // Shrink a translations file based on all the different translation // keys. print('Translating to pirate: $english'); case _: throw UnsupportError('Cannot determine which translations are used.'); } ``` ```dart switch (ship) { case InstanceConstantReference( instanceConstant: InstanceConstant( fields: {'name': StringConstant(value: final name)}, ), ): // Include the 3d model for this ship in the application but not // bundle the other ships. print('Pirate ship found: $name'); case _: throw UnsupportedError('Cannot determine which ships are used.'); } ``` commit 258d382 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 24 01:18:45 2026 -0800 [record_use] Simplify `Metadata` (dart-lang#3145) commit 37f263c Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 24 00:24:22 2026 -0800 [record_use] Add SymbolConstant support (dart-lang#3139) commit d4c6bf7 Author: Cairo09 <160388974+Cairo09@users.noreply.github.com> Date: Tue Feb 24 08:41:06 2026 +0530 [jnigen] Throw actionable error for wrong Java version (dart-lang#3130) commit 7d68fee Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 23 03:50:41 2026 -0800 [record_use] Enum value constants (dart-lang#3138) commit 8b2540a Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 23 02:38:54 2026 -0800 [record_use] Constant Record Values (dart-lang#3137) The `package:record_use` side of: * dart-lang#3054 commit 4f1aa00 Author: Ryota Kobayashi <45661924+naipaka@users.noreply.github.com> Date: Mon Feb 23 17:59:14 2026 +0900 [ffigen] Fix SDK path detection for non-standard Xcode paths (dart-lang#3135) commit dba74ff Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 20 02:40:26 2026 -0800 [record_use] Mark recorded classes as final (dart-lang#3131) At this point we don't want to support recording subtypes, we might allow this in the future, but we'll lock it down in the compiler for now. commit f855083 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 20 01:38:24 2026 -0800 [record_use] Static call receiver (dart-lang#3127) A field for storing receiver (non) constant values for static calls. Extension methods and extension types have receivers for their instance calls - which are static calls. Issue: * dart-lang#2948 commit 8a97f6b Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 20 01:13:15 2026 -0800 [record_use] Serialize `NonConstant` in the constant pool (dart-lang#3126) This simplifies code. (Especially for the follow up PR: dart-lang#3127) commit 4ff7f4c Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 20 00:45:37 2026 -0800 [record_use] Separate instance and static call recordings (dart-lang#3124) commit 4df61e8 Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 20 00:41:03 2026 -0800 [infra] Analyze the pubspec (dart-lang#3125) commit e10223f Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 19 09:41:34 2026 -0800 [record_use] Smaller ints for hashcodes (dart-lang#3128) commit 1ebc211 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 19 05:36:05 2026 -0800 [record_use] `LoadingUnit` Dart API (dart-lang#3123) Dart API for: * dart-lang#2979 * dart-lang#3022 In the future we might add the full graph of loading units if necessary. commit 3879dca Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 19 05:19:25 2026 -0800 [record_use] Store multiple loading units (dart-lang#3122) commit 1ef9fb1 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 19 02:07:15 2026 -0800 [record_use] JSON objects for loading units (dart-lang#3116) The storage part of: * dart-lang#2979 commit 5dbae2b Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 12:16:06 2026 -0800 [record_use] Move json strings in Dart to json files (dart-lang#3112) Lets have all test data in the same format. Simplifies things. commit 1ccc1b7 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 11:48:11 2026 -0800 [record_use] Instance constant definitions (dart-lang#3121) Reland of dart-lang#3110 to the right branch. (GitHub sometimes rebases stacked PRs to main and sometimes doesn't...) commit b88982b Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 09:28:07 2026 -0800 [record_use] Normalize definitions in JSON (dart-lang#3109) Move the definitions into their own toplevel index. Towards: * dart-lang#2867 Implementation follows the design from: * dart-lang#3106 commit f36ecbf Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 09:13:22 2026 -0800 [record_use] Refactor (de)serialization order (dart-lang#3108) commit 71b7a66 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 07:43:25 2026 -0800 [record_use] (De)serialization context (dart-lang#3107) commit 1931ea5 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 04:04:40 2026 -0800 [infra] Skip generated packages from workspace check (dart-lang#3120) commit 47fef8e Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 18 02:23:05 2026 -0800 [infra] Add license checker to ci script (dart-lang#3114) commit 8bf375e Author: Michael Goderbauer <goderbauer@google.com> Date: Wed Feb 18 10:04:11 2026 +0100 [infra] add check to ensure all packages are accounted for in workspace (dart-lang#2969) commit 938b861 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 17 08:26:48 2026 -0800 [record_use] Adopt `DefinitionKind` in test data (dart-lang#3118) commit e2f959d Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 17 00:37:20 2026 -0800 [hooks_runner] Add missing license header (dart-lang#3113) commit 5504267 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 17 00:25:56 2026 -0800 [hooks_runner] Slow test (dart-lang#3111) commit a916dd3 Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 16 22:20:16 2026 -0800 [hooks_runner] Add `CCACHE_` env variables to allowlist (dart-lang#3103) commit 9d22ed8 Author: Hassnaa Mohamed <mhassna727@gmail.com> Date: Tue Feb 17 02:29:02 2026 +0200 [swift2objc] feat: Generate implicit constructors for Swift structs (dart-lang#2940) commit afcf7c4 Author: Cairo09 <160388974+Cairo09@users.noreply.github.com> Date: Tue Feb 17 05:52:41 2026 +0530 [ffigen] allow isA (null) to return false for ObjCobject (dart-lang#3059) commit 2e84fb9 Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 16 04:32:38 2026 -0800 [infra] Bump SDK version to 3.10.0 (dart-lang#3104) commit 14169ab Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 16 01:10:25 2026 -0800 [infra] Contribution and PR docs (dart-lang#3099) commit f08a85b Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 16 01:06:49 2026 -0800 [record_use] `Definition` rework JSON encoding (dart-lang#3091) commit a44ec6c Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 16 00:59:26 2026 -0800 [hooks_runner] Fix flaky test (dart-lang#3101) commit 7f2cfc4 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 05:42:25 2026 -0800 [infra] Add a `--fix` flag to the ci tool (dart-lang#3090) The generate task needs to go before the others in case it generates bad code. commit ec7142f Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 04:14:42 2026 -0800 [infra] Add `dart_apitool` check to `ci.dart` (dart-lang#3082) commit 6b1dfa7 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 04:14:05 2026 -0800 [infra] Toplevel analysis options (dart-lang#3084) commit ed8075b Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 04:08:31 2026 -0800 [infra] Format tools directory (dart-lang#3089) commit 91d34c6 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 03:35:28 2026 -0800 [record_use] Use `update_snippets.dart` (dart-lang#3087) Fix the doc comments in this package. * Fixes the docs to be up to date with current usage. * Adds a pirate themed API doc. * Ignores the use cases for now. * In the future we should make these full fledged examples in the examples/ dir. * Makes the snippets tool more powerful with anchors and nested snippets. commit 73ba13f Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 02:26:25 2026 -0800 [record_use] Rework `Definition`s (dart-lang#3075) This change addresses the ambiguity issues in how we identify Dart definitions. The new API ensures we can unambiguously capture and reference all kinds of statically resolved symbols across classes, extensions, and extension types. Related bugs: * dart-lang#2888 * dart-lang#3062 Each segment in the path is now a `Name` object containing: * `name`: The string identifier. * `kind`: A `DefinitionKind` (e.g., `classKind`, `methodKind`, `getterKind`, `setterKind`, `operatorKind`). * `disambiguators`: A `Set<DefinitionDisambiguator>` used to distinguish between `static` and `instance` members, which is critical for extensions and extension types. The `kind` and `disambiguators` are null. Setting them non-null will be done in a follow up PR. Implemented a "smart" `toString()` that produces valid, URI-friendly strings for use in tooling and documentation. * **Format:** `library#kind:name@disambiguator::kind:name` * **Example:** `package:my_pkg/foo.dart#class:MyClass::method:myMethod@static` (Taken from discussions on dart-lang/language#4616) commit 8fcc79b Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 02:23:01 2026 -0800 [pub_formats] Add missing dependency (dart-lang#3088) commit ddb91fe Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 12 02:11:35 2026 -0800 [pub_formats] Add analysis options (dart-lang#3083) commit cc90d34 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 06:07:26 2026 -0800 [ffi] Export leaked types (dart-lang#3081) This is causing flags on Dart API Tool runs. We should just export them. commit 1bd5bb8 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 05:45:58 2026 -0800 [infra] Delete `repo_lint_rules` and remove `custom_lint` (dart-lang#3080) commit cce2932 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 05:07:47 2026 -0800 [record_use] Rename `Identifier` to `Definition` (dart-lang#3076) commit c6aca4e Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 04:46:38 2026 -0800 [hooks_runner] Increase test timeout (dart-lang#3079) commit f1b6ca6 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 04:21:00 2026 -0800 [infra] Parallelize tool/ci.dart PubTask, GenerateTask, and ExampleTask (dart-lang#3074) commit 19365f6 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 04:20:39 2026 -0800 [infra] Add `--fast` to `tool/ci.dart` (dart-lang#3073) commit 0343aba Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 04:17:24 2026 -0800 [record_use] Require `package:` URIs in schema (dart-lang#3071) Add `package:` library check to the json schema and validator. Follow up of: * dart-lang#3069 * dart-lang#2891 commit 0838740 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 04:02:09 2026 -0800 [record_use] Run validation in `Recordings.fromJson` (dart-lang#3078) dart-lang#3064 revealed we weren't ever running the validator. Refiling of: * dart-lang#3070 commit 9084e1d Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 03:41:45 2026 -0800 [record_use] Update test data to `package:` URIs and cleanup dart2js tests (dart-lang#3077) commit 4689b4b Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 11 00:45:40 2026 -0800 [infra] ignore nested .dart_tool and other generated files (dart-lang#3066) commit 898141e Author: Hassnaa Mohamed <hm2922@fayoum.edu.eg> Date: Tue Feb 10 02:52:09 2026 +0200 [swift2objc] feat: support operator overloading (dart-lang#2972) commit 0e06fcf Author: Daco Harkes <dacoharkes@google.com> Date: Mon Feb 9 09:32:06 2026 -0800 [record_use] Remove definition loading unit (dart-lang#3061) In `dart2js`, definitions currently include a `loading_unit` property which typically represents the "dominating" loading unit (the shared ancestor of all loading units where that definition is used). When assets are associated with a definition, using this definition-level `loading_unit` can lead to assets being loaded too early. For example, if a definition is used in two different deferred loading units, its dominating unit might be the main bundle. Loading the asset in the main bundle defeats the purpose of deferring it. To fix this, we want to postpone asset loading until one of the actual loading units that uses the definition is loaded. Since every recorded `Call` and `Instance` already includes its own `loading_unit`, the property on the `Definition` itself is redundant and misleading for the web backend. Closes: dart-lang#2986 Issues to be addressed in follow up PRs: * dart-lang#3022 * dart-lang#2888 - Removed `loading_unit` from the `Definition` object in `record_use.schema.json`. - Updated `Recording` to use `identifier` directly as its key property. - Removed the `Definition` class. `Recordings` now uses `Identifier` as the primary key for the `callsForDefinition` and `instancesForDefinition` maps. - Added a `TODO` to `Identifier` to rename it to `Definition` in a future refactor ([dart-lang#2888](dart-lang#2888)). commit 51d34eb Author: Daco Harkes <dacoharkes@google.com> Date: Fri Feb 6 09:30:37 2026 -0800 [record_use] Support unsupported constants (dart-lang#3056) commit 0819678 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 5 07:21:07 2026 -0800 [record_use] Add constructor invocations to recorded instances (dart-lang#3047) Refactored `InstanceReference` into a sealed class hierarchy to support constructor invocations and tear-offs alongside constant instances. - **Hierarchy:** Introduced `InstanceConstantReference`, `InstanceCreationReference`, and `ConstructorTearoffReference`. - **Schema:** Updated `record_use.schema.json` with a `type` discriminator for instances and regenerated `syntax.g.dart`. - **API:** Updated `Recordings` and `RecordedUsages` to handle the polymorphic types and improved semantic equality comparison. - **Migration:** Updated all JSON test data to include the required `"type": "constant"` field and ensured trailing newlines. - **Testing:** Added `test/instance_references_test.dart` and updated schema validation tests. Relevant issues: * dart-lang#2907 * dart-lang#2911 commit 918a5a8 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 5 06:55:55 2026 -0800 [native_toolchain_c] Increase test timeout (dart-lang#3051) commit 8b9b5a6 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 5 06:45:20 2026 -0800 [record_use] `Identifiers` must only have `package` uris (dart-lang#3045) Bug: dart-lang#2891 (Needs a PR in the Dart SDK as well to avoid recording things outside package uris.) commit e359106 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 5 06:05:31 2026 -0800 [record_use] Remove source locations (dart-lang#3043) This PR completely removes source location tracking (URI, line, column) from the `record_use` package. This type of debug information should not be needed for errors from a link hook if the APIs annotated with `@RecordUse()` are already annotated with `@mustBeConst`. Closes: dart-lang#3023 commit 4003fc3 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 5 05:43:24 2026 -0800 [hooks_runner] Filter recorded uses on definition package name (dart-lang#3041) Closes: dart-lang#3003 This PR introduces filtering for `recorded_uses.json` passed to link hooks. Instead of providing all recorded usages from the entire application to every link hook, each hook now receives only the usages of definitions defined within its own package. - **`NativeAssetsBuildRunner.link`**: - Now parses the `resourceIdentifiers` (if provided). - Iterates through each package in the build plan. - Filters the `Recordings` to include only those where the definition belongs to the current package. - Writes the filtered recordings to a `recorded_uses.json` file in the package's build directory. - Passes this filtered file to the link hook input. - **`Recordings` class**: - Added a `filter({String? definitionPackageName})` method. - This method filters `callsForDefinition` and `instancesForDefinition` based on the `importUri` of the definition, checking if it starts with `package:<definitionPackageName>/`. - Added `pkgs/hooks_runner/test/build_runner/resources_test.dart`: - **`simple_link linking`**: Verifies basic linking behavior. - **`record_use_filtering linking`**: A complex test case involving three packages (`pirate_adventure`, `pirate_speak`, `pirate_technology`). - `pirate_adventure` (the app) calls functions in the other two packages. - The test verifies that the link hook for `pirate_speak` only receives recordings for `pirateSpeak` and `pirate_technology` only receives recordings for `useCannon`. - Verifies that the output assets are correctly generated based on this filtered input (treeshaking simulation). - Added test data in `pkgs/hooks_runner/test_data/`: - `pirate_adventure`: The main application. - `pirate_speak`: A library with a link hook that processes recordings. - `pirate_technology`: Another library with a link hook. Previously, link hooks received the global set of recorded uses. This was inefficient and potentially leaked information between packages. By filtering the recordings, we ensure that: 1. Link hooks only process data relevant to them (treeshaking their own assets). 2. We avoid passing unnecessary data across package boundaries during the build process. commit 9ebc083 Author: Daco Harkes <dacoharkes@google.com> Date: Thu Feb 5 05:14:21 2026 -0800 [record_use] Update MapConstant to support non-string keys (dart-lang#3037) Bug: dart-lang#2715 Will require in implementation in the Dart SDK, and a manual roll due to breaking change in json format. commit 4c78a12 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 4 10:13:08 2026 -0800 [record_use] Remove annotation recording examples (dart-lang#3046) Bug: dart-lang#2977 Required to make https://dart-review.googlesource.com/c/sdk/+/478440 green. commit 7324caf Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 4 09:05:39 2026 -0800 [native_toolchain_c] Don't require lld on `PATH` for MacOS -> Linux (dart-lang#3044) commit 7eab15e Author: Daco Harkes <dacoharkes@google.com> Date: Wed Feb 4 08:44:42 2026 -0800 [hooks_runner] Release 1.0.2 (dart-lang#3042) commit 4581b84 Author: Liam Appelbe <liama@google.com> Date: Wed Feb 4 14:08:54 2026 +1100 [ffigen] Fix new use_null_aware_elements lint (dart-lang#3038) commit ee71532 Author: Gurleen Kaur <174241618+Gurleen-kansray@users.noreply.github.com> Date: Wed Feb 4 04:15:19 2026 +0530 [objective_c] Make autoReleasePool return callback value (dart-lang#3033) commit 4c03068 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Feb 3 08:47:36 2026 -0800 [hooks] Document hook env vars (dart-lang#3034) commit 39e3e71 Author: Liam Appelbe <liama@google.com> Date: Thu Jan 29 11:46:01 2026 +1100 [objective_c] Prepare to publish (dart-lang#3024) commit f67abb7 Author: Liam Appelbe <liama@google.com> Date: Thu Jan 29 10:05:22 2026 +1100 [ffigen] Fix transitive inclusion edge cases (dart-lang#2998) commit 87f554b Author: Liam Appelbe <liama@google.com> Date: Thu Jan 29 09:25:29 2026 +1100 [infra] Add needs-triage label to all new bugs (dart-lang#3015) commit 8fe4664 Author: Hannes Winkler <hanneswinkler2000@web.de> Date: Wed Jan 28 12:25:44 2026 +0100 [native_toolchain_c] fix unportable link arg (dart-lang#3005) commit 8454e25 Author: Ponng <88756812+zhponng@users.noreply.github.com> Date: Wed Jan 28 11:36:44 2026 +0800 [objective_c] feat: Add minimum OS version flags to build script (dart-lang#3016) commit 0a37fd3 Author: Liam Appelbe <liama@google.com> Date: Wed Jan 28 09:05:38 2026 +1100 [ffigen] Always sort bindings (dart-lang#3010) commit 4298a2e Author: Loïc Sharma <737941+loic-sharma@users.noreply.github.com> Date: Mon Jan 26 23:50:28 2026 -0800 [ffi] Fix utf8.dart typo (dart-lang#3007) commit 7d07eb5 Author: Liam Appelbe <liama@google.com> Date: Fri Jan 23 10:43:39 2026 +1100 [objective_c] Prepare to publish 9.2.4 (dart-lang#3002) commit f77246f Author: Marinko <marinkobabic@users.noreply.github.com> Date: Fri Jan 23 00:30:51 2026 +0100 [objective_c] - fix private pub dev issue (dart-lang#2996) commit d296579 Author: Liam Appelbe <liama@google.com> Date: Thu Jan 22 09:54:26 2026 +1100 [native_toolchain_c] Use `-encryptable` linker flag (dart-lang#2982) commit bf77b81 Author: Daco Harkes <dacoharkes@google.com> Date: Wed Jan 21 12:27:39 2026 +0100 [record_use] Integration test case for library-uris (dart-lang#2987) commit 7f45c84 Author: Liam Appelbe <liama@google.com> Date: Wed Jan 21 10:03:44 2026 +1100 [ffigen] Fix block helper naming bug (dart-lang#2963) commit 9c9b31c Author: Liam Appelbe <liama@google.com> Date: Wed Jan 21 09:39:24 2026 +1100 [jnigen] Kotlin void suspend funcs now return Future<void> in Dart (dart-lang#2922) commit 67ea02e Author: Liam Appelbe <liama@google.com> Date: Wed Jan 21 09:27:59 2026 +1100 [objective_c] Fix a code signing bug (dart-lang#2975) commit 34a8b7c Author: Liam Appelbe <liama@google.com> Date: Wed Jan 21 09:22:37 2026 +1100 [native_toolchain_c] Clarify compiler/linker in cbuilder docs (dart-lang#2936) commit 6127a50 Author: Daco Harkes <dacoharkes@google.com> Date: Tue Jan 20 14:52:40 2026 +0100 [hooks_runner] Remove unused dep from test data (dart-lang#2971) commit 2f33e1a Author: Daco Harkes <dacoharkes@google.com> Date: Tue Jan 20 09:32:24 2026 +0100 [record_use] Remove internal `fromJson` and `toJson` (dart-lang#2985) This PR only leaves the top level `Recordings` and `RecordedUsages` JSON APIs. All internal from and to json have been removed. The format uses normalization (with constant indices), which means the to and from JSON of parts of the format are not useful by themselves. Users should not try to use JSON serialization of parts of the format, only the full format. Closes: dart-lang#2901 This will require a manual roll into the Dart SDK to migrate `Metadata.fromJson` constructor calls. commit d5ff8ed Author: Daco Harkes <dacoharkes@google.com> Date: Tue Jan 20 09:26:37 2026 +0100 [record_use] Use `snake_case` in JSON (dart-lang#2978) commit c26f756 Author: Daco Harkes <dacoharkes@google.com> Date: Mon Jan 19 14:12:23 2026 +0100 [record_use] Record use cases (dart-lang#2976) Document all the `package:record_use` use cases and what features they would need from `package:record_use` and the compiler implementations populating the recorded use file. commit 4fe954c Author: Michael Goderbauer <goderbauer@google.com> Date: Fri Jan 16 15:28:17 2026 +0100 Remove outdated TODO from root pubspec.yaml (dart-lang#2970) commit d1bbeea Author: Michael Goderbauer <goderbauer@google.com> Date: Fri Jan 16 14:36:15 2026 +0100 [infra] add `ffi` to workspace (dart-lang#2966) commit 30ee3d7 Author: Michael Goderbauer <goderbauer@google.com> Date: Fri Jan 16 10:57:55 2026 +0100 Simplify native.yaml (dart-lang#2965) The "experiment" is no longer an experiment and now available on stable. commit ab60a15 Author: Michael Goderbauer <goderbauer@google.com> Date: Fri Jan 16 09:11:05 2026 +0100 [swift2objc] Fix link to repository in pubspec (dart-lang#2958) commit 0c4cad2 Author: Michael Goderbauer <goderbauer@google.com> Date: Fri Jan 16 09:10:46 2026 +0100 [infra] Bump ffigen,objective_c,swiftgen dependencies (dart-lang#2957) commit b45b6ae Author: Liam Appelbe <liama@google.com> Date: Fri Jan 16 08:47:05 2026 +1100 [swift2objc] Enum support (dart-lang#2955) commit 20d244b Author: Michael Goderbauer <goderbauer@google.com> Date: Thu Jan 15 11:13:08 2026 +0100 [infra] Bump workspace dependencies (dart-lang#2956) Partially supersedes dart-lang#2833. commit 35d02e8 Author: Liam Appelbe <liama@google.com> Date: Thu Jan 15 09:42:03 2026 +1100 [swiftgen] Integration tests for callbacks and protocols (dart-lang#2949) commit c4f419c Author: Daco Harkes <dacoharkes@google.com> Date: Wed Jan 14 11:58:19 2026 +0100 [record_use] Fix positional argument semantic equality (dart-lang#2950)


Description
This PR implements automatic generation of implicit memberwise constructors for Swift structs that don't have explicit initializers, as described in issue #2668.
Swift automatically provides a memberwise initializer for structs when no explicit initializers are defined. Since these implicit initializers don't appear in the symbolgraph JSON that swift2objc parses, we need to detect and generate them manually during the transformation phase.
Changes
transform_compound.dart: Added logic to detect structs without explicit initializers and generate an implicitInitializerDeclarationwith parameters matching all stored properties!isStatic)hasSetter == true, not computed)implicit_initializer_test.dartcovering:Testing
Example
Input Swift struct:
Generated wrapper now includes:
Related Issue
Closes #2668