Skip to content
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

[multiple] Avoid new unreachable_switch_default warning. #54996

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

stereotype441
Copy link
Contributor

The Dart analyzer will soon be changed so that if the default clause of a switch statement is determined to be unreachable by the exhaustiveness checker, a new warning of type
unreachable_switch_default will be issued. This parallels the behavior of the existing unreachable_switch_case warning, which is issued whenever a case clause of a switch statement is determined to be unreachable.

Before adding the new warning to the analyzer, code in the engine needs to first be updated to eliminate these unreachable default clauses, so that the warning won't cause builds to break.

For more information, see
dart-lang/sdk#54575.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

The Dart analyzer will soon be changed so that if the `default` clause
of a `switch` statement is determined to be unreachable by the
exhaustiveness checker, a new warning of type
`unreachable_switch_default` will be issued. This parallels the
behavior of the existing `unreachable_switch_case` warning, which is
issued whenever a `case` clause of a `switch` statement is determined
to be unreachable.

Before adding the new warning to the analyzer, code in the engine
needs to first be updated to eliminate these unreachable `default`
clauses, so that the warning won't cause builds to break.

For more information, see
dart-lang/sdk#54575.
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Sep 6, 2024
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm

@stereotype441 stereotype441 merged commit 8fc5c65 into flutter:main Sep 6, 2024
27 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 6, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Sep 7, 2024
…154764)

flutter/engine@419fb8c...b9f9015

2024-09-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[skwasm] use temporary RawPaint objects (#54917)" (flutter/engine#55018)
2024-09-06 [email protected] [engine] reland: always post tasks for platform channel responses. (flutter/engine#55006)
2024-09-06 [email protected] Roll Skia from 4786936b4c0c to 06cd203d0607 (2 revisions) (flutter/engine#55014)
2024-09-06 [email protected] [multiple] Avoid new `unreachable_switch_default` warning. (flutter/engine#54996)
2024-09-06 [email protected] [skwasm] use temporary RawPaint objects (flutter/engine#54917)
2024-09-06 [email protected] [DisplayList] use DlScalar, DlPoint, DlRect exclusively in DlOpReceiver methods (flutter/engine#54982)
2024-09-06 [email protected] Roll Skia from f38ea0134dba to 4786936b4c0c (4 revisions) (flutter/engine#55013)
2024-09-06 [email protected] [Impeller] opt into exp canvas. (flutter/engine#54913)
2024-09-06 [email protected] Roll Skia from 8f62a6a4a299 to f38ea0134dba (4 revisions) (flutter/engine#55008)
2024-09-06 [email protected] [impeller] fake image for fake tests. (flutter/engine#54974)
2024-09-06 [email protected] Roll Skia from 6ad117bd2efe to 8f62a6a4a299 (1 revision) (flutter/engine#55001)
2024-09-06 [email protected] Change "there own" to "their own" in Flutter-GPU docs (flutter/engine#54921)

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 [email protected],[email protected],[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
auto-submit bot added a commit to flutter/flutter that referenced this pull request Sep 7, 2024
…visions) (#154764)" (#154765)

Reverts: #154764
Initiated by: jonahwilliams
Reason for reverting: failing post submit on mac module test.
Original PR Author: engine-flutter-autoroll

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:

flutter/engine@419fb8c...b9f9015

2024-09-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[skwasm] use temporary RawPaint objects (#54917)" (flutter/engine#55018)
2024-09-06 [email protected] [engine] reland: always post tasks for platform channel responses. (flutter/engine#55006)
2024-09-06 [email protected] Roll Skia from 4786936b4c0c to 06cd203d0607 (2 revisions) (flutter/engine#55014)
2024-09-06 [email protected] [multiple] Avoid new `unreachable_switch_default` warning. (flutter/engine#54996)
2024-09-06 [email protected] [skwasm] use temporary RawPaint objects (flutter/engine#54917)
2024-09-06 [email protected] [DisplayList] use DlScalar, DlPoint, DlRect exclusively in DlOpReceiver methods (flutter/engine#54982)
2024-09-06 [email protected] Roll Skia from f38ea0134dba to 4786936b4c0c (4 revisions) (flutter/engine#55013)
2024-09-06 [email protected] [Impeller] opt into exp canvas. (flutter/engine#54913)
2024-09-06 [email protected] Roll Skia from 8f62a6a4a299 to f38ea0134dba (4 revisions) (flutter/engine#55008)
2024-09-06 [email protected] [impeller] fake image for fake tests. (flutter/engine#54974)
2024-09-06 [email protected] Roll Skia from 6ad117bd2efe to 8f62a6a4a299 (1 revision) (flutter/engine#55001)
2024-09-06 [email protected] Change "there own" to "their own" in Flutter-GPU docs (flutter/engine#54921)

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 [email protected],[email protected],[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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Sep 7, 2024
…154769)

flutter/engine@419fb8c...7bf1169

2024-09-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[engine] reland: always post tasks for platform channel responses. (#55006)" (flutter/engine#55022)
2024-09-07 [email protected] Turn off software rendering in iOS scenario golden tests (flutter/engine#55016)
2024-09-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[skwasm] use temporary RawPaint objects (#54917)" (flutter/engine#55018)
2024-09-06 [email protected] [engine] reland: always post tasks for platform channel responses. (flutter/engine#55006)
2024-09-06 [email protected] Roll Skia from 4786936b4c0c to 06cd203d0607 (2 revisions) (flutter/engine#55014)
2024-09-06 [email protected] [multiple] Avoid new `unreachable_switch_default` warning. (flutter/engine#54996)
2024-09-06 [email protected] [skwasm] use temporary RawPaint objects (flutter/engine#54917)
2024-09-06 [email protected] [DisplayList] use DlScalar, DlPoint, DlRect exclusively in DlOpReceiver methods (flutter/engine#54982)
2024-09-06 [email protected] Roll Skia from f38ea0134dba to 4786936b4c0c (4 revisions) (flutter/engine#55013)
2024-09-06 [email protected] [Impeller] opt into exp canvas. (flutter/engine#54913)
2024-09-06 [email protected] Roll Skia from 8f62a6a4a299 to f38ea0134dba (4 revisions) (flutter/engine#55008)
2024-09-06 [email protected] [impeller] fake image for fake tests. (flutter/engine#54974)
2024-09-06 [email protected] Roll Skia from 6ad117bd2efe to 8f62a6a4a299 (1 revision) (flutter/engine#55001)
2024-09-06 [email protected] Change "there own" to "their own" in Flutter-GPU docs (flutter/engine#54921)

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 [email protected],[email protected],[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
jesswrd pushed a commit to jesswrd/engine that referenced this pull request Sep 11, 2024
…4996)

The Dart analyzer will soon be changed so that if the `default` clause
of a `switch` statement is determined to be unreachable by the
exhaustiveness checker, a new warning of type
`unreachable_switch_default` will be issued. This parallels the behavior
of the existing `unreachable_switch_case` warning, which is issued
whenever a `case` clause of a `switch` statement is determined to be
unreachable.

Before adding the new warning to the analyzer, code in the engine needs
to first be updated to eliminate these unreachable `default` clauses, so
that the warning won't cause builds to break.

For more information, see
dart-lang/sdk#54575.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants