[pigeon] Use function types in order to avoid dynamic calls#11130
[pigeon] Use function types in order to avoid dynamic calls#11130auto-submit[bot] merged 2 commits intoflutter:mainfrom
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request refactors several methods in the Indent class within packages/pigeon/lib/src/generator_tools.dart. Specifically, the func parameter in addScoped, writeScoped, and nest methods has been updated from the generic Function type to the more specific void Function(). This enhances type safety and, as a result, a lint suppression comment for avoid_dynamic_calls has been removed from the nest method.
|
I read through the CHANGELOG policy, but I'm still not certain whether this requires a changelog entry or not. 😅 |
|
test-exempt: code refactor with no semantic change |
|
We can exempt this from the usual version and changelog requirement since it's so clearly a no-op for clients. |
flutter/packages@e1d0169...a27d7c5 2026-02-26 [email protected] [pigeon] Tidy GeneratorAdapters to be const, with getters instead of fields (flutter/packages#11131) 2026-02-26 [email protected] [webview_flutter] Remove usesCleartextTraffic (flutter/packages#11124) 2026-02-26 [email protected] [pigeon]: Correct comment references in doc comments (flutter/packages#11129) 2026-02-26 [email protected] [webview_flutter_android] Remove usesCleartextTraffic (flutter/packages#11122) 2026-02-26 [email protected] Roll Flutter from dad6f9d to b31548f (39 revisions) (flutter/packages#11116) 2026-02-26 [email protected] [espresso] Remove usesCleartextTraffic (flutter/packages#11125) 2026-02-26 [email protected] [pigeon] Use function types in order to avoid dynamic calls (flutter/packages#11130) 2026-02-26 [email protected] [shared_preferences] Revert androidx.datastore:datastore to 1.1.7 (flutter/packages#11128) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#183009) flutter/packages@e1d0169...a27d7c5 2026-02-26 [email protected] [pigeon] Tidy GeneratorAdapters to be const, with getters instead of fields (flutter/packages#11131) 2026-02-26 [email protected] [webview_flutter] Remove usesCleartextTraffic (flutter/packages#11124) 2026-02-26 [email protected] [pigeon]: Correct comment references in doc comments (flutter/packages#11129) 2026-02-26 [email protected] [webview_flutter_android] Remove usesCleartextTraffic (flutter/packages#11122) 2026-02-26 [email protected] Roll Flutter from dad6f9d to b31548f (39 revisions) (flutter/packages#11116) 2026-02-26 [email protected] [espresso] Remove usesCleartextTraffic (flutter/packages#11125) 2026-02-26 [email protected] [pigeon] Use function types in order to avoid dynamic calls (flutter/packages#11130) 2026-02-26 [email protected] [shared_preferences] Revert androidx.datastore:datastore to 1.1.7 (flutter/packages#11128) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Each callback is expected to take zero parameters, and a return type of void allows all return types.
This removes a dynamic call, and improves type safety.
Pre-Review Checklist
[shared_preferences]///).