-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Fix narrowing conversion lint #47740
Conversation
Internally we have a lint that surfaces this as a warning. Related: b/309552840
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). 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. |
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.
…138091) flutter/engine@3e3be5e...117d47a 2023-11-08 skia-flutter-autoroll@skia.org Roll Skia from fce71a80b0a2 to a4cce5236dcf (1 revision) (flutter/engine#47807) 2023-11-08 chris@bracken.jp [macOS] Clean up resources in ViewController tests (flutter/engine#47792) 2023-11-08 skia-flutter-autoroll@skia.org Roll Skia from f3d250126ba9 to fce71a80b0a2 (1 revision) (flutter/engine#47796) 2023-11-08 skia-flutter-autoroll@skia.org Roll Skia from b4fa927468e6 to f3d250126ba9 (1 revision) (flutter/engine#47793) 2023-11-08 flar@google.com [Impeller] Add Rect::GetNormalizingTransform to handle UV coordinate conversion (flutter/engine#47775) 2023-11-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove Fuchsia Mac SDK from DEPS" (flutter/engine#47791) 2023-11-08 yjbanov@google.com [web] fix clicks on merged semantic nodes (attempt #2) (flutter/engine#47360) 2023-11-08 skia-flutter-autoroll@skia.org Roll Skia from 0f78e5f765d3 to b4fa927468e6 (1 revision) (flutter/engine#47788) 2023-11-08 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from VcFEJiUUTYwkhEAlJ... to sD8HRA4JmXczujkqO... (flutter/engine#47785) 2023-11-08 jiahaog@users.noreply.github.com Fix narrowing conversion lint (flutter/engine#47740) 2023-11-08 chris@bracken.jp [macOS] Bail out of tests if engine not running (flutter/engine#47771) 2023-11-08 skia-flutter-autoroll@skia.org Roll Skia from f91d39395e85 to 0f78e5f765d3 (1 revision) (flutter/engine#47776) 2023-11-08 chris@bracken.jp [testing] Extract StreamCapture test utility (flutter/engine#47774) 2023-11-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Promote fuchsia build v2 to prod." (flutter/engine#47779) 2023-11-08 aam@google.com Include updated locations for dart third_party components into license ignore-list. (flutter/engine#47770) 2023-11-07 chillers@google.com Remove Fuchsia Mac SDK from DEPS (flutter/engine#47700) 2023-11-07 skia-flutter-autoroll@skia.org Roll Skia from 030e21befbc9 to f91d39395e85 (6 revisions) (flutter/engine#47769) 2023-11-07 chinmaygarde@google.com [Impeller] Support static thread safety analysis with condition variables. (flutter/engine#47763) 2023-11-07 godofredoc@google.com Promote fuchsia build v2 to prod. (flutter/engine#47729) 2023-11-07 737941+loic-sharma@users.noreply.github.com [Windows] Reduce warnings produced by unit tests (flutter/engine#47724) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from VcFEJiUUTYwk to sD8HRA4JmXcz If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,rmistry@google.com,zra@google.com 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
Internally we have a lint that surfaces this as a warning. Googlers, please refer to go/al-rule/NarrowingConversion.
Related: b/309552840
When we do:
coordsList.get(3)
is casted to adouble
, then afloat
, before the multiplication happens.I don't think this is intentional. The intention of the code here seems to be:
double
:coordsList
is aList<Object>
so the cast narrows the valuefloat
: To fit the resulting value intocoords.toolMajor
, which is afloat
.As such, add parenthesis to address this.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.