Sitelet https://github.com/flutter/flutter/pull/192229
Skip to content

Replace more enum instances comparison to use equality == instead of identical and update related tests - #192229

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
AbdeMohlbi:issue_1811_part_5
Sep 9, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
AbdeMohlbi:issue_1811_part_5

Conversation

@AbdeMohlbi

Copy link
Copy Markdown
Member

related PRs:

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@AbdeMohlbi AbdeMohlbi added the CICD Run CI/CD label Sep 3, 2026
@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 3, 2026
import 'package:flutter_test/flutter_test.dart';

void main() {
// Here and below, see: https://github.com/dart-lang/sdk/issues/26980

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test('FlutterLogoDecoration.lerp identical a,b', () {
expect(FlutterLogoDecoration.lerp(null, null, 0), null);
const logo = FlutterLogoDecoration();
expect(identical(FlutterLogoDecoration.lerp(logo, logo, 0.5), logo), true);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't have a problem with not removing identical here but this will mean that we are not consistent on what we use and where, either way the test pass.

@AbdeMohlbi
AbdeMohlbi marked this pull request as ready for review September 3, 2026 09:52

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces identical checks with equality operators (==) in FlutterLogoDecoration and its tests, and removes an outdated comment. Feedback points out that changing identical to == in the test weakens the verification of referential identity, which is an important performance optimization for lerp functions.

expect(FlutterLogoDecoration.lerp(null, null, 0), null);
const logo = FlutterLogoDecoration();
expect(identical(FlutterLogoDecoration.lerp(logo, logo, 0.5), logo), true);
expect(FlutterLogoDecoration.lerp(logo, logo, 0.5) == logo, true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This test is specifically verifying that FlutterLogoDecoration.lerp returns the identical instance (referential identity) when a and b are identical, which is an important performance optimization in Flutter's lerp functions. Changing this to == weakens the test, as it would pass even if lerp returned a newly allocated but equal instance. Since FlutterLogoDecoration is a class and not an enum, we should keep the identical check here.

    expect(identical(FlutterLogoDecoration.lerp(logo, logo, 0.5), logo), true);

@AbdeMohlbi AbdeMohlbi Sep 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not matter we have the correct behavior of equality now in dart, see #192229 (comment), either way let's wait for a review

@Renzo-Olivares Renzo-Olivares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Renzo-Olivares Renzo-Olivares added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 9, 2026
Merged via the queue into flutter:master with commit 3b192e9 Sep 9, 2026
22 of 23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 9, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 9, 2026
flutter/flutter@b444e78...63b9518

2026-09-09 engine-flutter-autoroll@skia.org Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 mdebbar@google.com Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 30870216+gaaclarke@users.noreply.github.com Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 srawlins@google.com [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 srawlins@google.com [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 bkonyi@google.com [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 bkonyi@google.com [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 116356835+AbdeMohlbi@users.noreply.github.com Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 1961493+harryterkelsen@users.noreply.github.com [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 bkonyi@google.com [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 1961493+harryterkelsen@users.noreply.github.com [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 bkonyi@google.com [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 bkonyi@google.com [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 1961493+harryterkelsen@users.noreply.github.com Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 chris@bracken.jp et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 kevmoo@users.noreply.github.com Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 bkonyi@google.com [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 bkonyi@google.com [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 bkonyi@google.com [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 bkonyi@google.com [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 71131015+wratheus@users.noreply.github.com Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12814)

flutter/flutter@b444e78...63b9518

2026-09-09 engine-flutter-autoroll@skia.org Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 mdebbar@google.com Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 30870216+gaaclarke@users.noreply.github.com Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 srawlins@google.com [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 srawlins@google.com [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 bkonyi@google.com [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 bkonyi@google.com [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 116356835+AbdeMohlbi@users.noreply.github.com Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 1961493+harryterkelsen@users.noreply.github.com [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 bkonyi@google.com [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 1961493+harryterkelsen@users.noreply.github.com [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 bkonyi@google.com [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 bkonyi@google.com [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 1961493+harryterkelsen@users.noreply.github.com Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 chris@bracken.jp et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 kevmoo@users.noreply.github.com Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 bkonyi@google.com [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 bkonyi@google.com [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 bkonyi@google.com [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 bkonyi@google.com [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 71131015+wratheus@users.noreply.github.com Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12814)

flutter/flutter@b444e78...63b9518

2026-09-09 engine-flutter-autoroll@skia.org Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 mdebbar@google.com Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 30870216+gaaclarke@users.noreply.github.com Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 srawlins@google.com [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 srawlins@google.com [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 bkonyi@google.com [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 bkonyi@google.com [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 116356835+AbdeMohlbi@users.noreply.github.com Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 1961493+harryterkelsen@users.noreply.github.com [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 bkonyi@google.com [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 1961493+harryterkelsen@users.noreply.github.com [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 bkonyi@google.com [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 bkonyi@google.com [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 1961493+harryterkelsen@users.noreply.github.com Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 chris@bracken.jp et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 kevmoo@users.noreply.github.com Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 bkonyi@google.com [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 bkonyi@google.com [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 bkonyi@google.com [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 bkonyi@google.com [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 71131015+wratheus@users.noreply.github.com Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants