-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
No warning for unreachable break #3511
Comments
While this kind of detection is not required by the spec, I do agree that it would be good to have. Added this to the Later milestone. |
Removed this from the M3 milestone. |
This comment was originally written by amouravski@google.com Added Editor-AnalysisEngine label. |
Removed AnalysisEngine, Editor-AnalysisEngine labels. |
Removed Type-Defect label. |
Added Analyzer-Hint label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
"or unreachable" seems strange to pair with this request. Aren't any unreachable statements just dead code (a warning that already exists). Or, for the following code, would you like two warnings (DEAD_CODE, INFINITE_LOOP): while (true) {
// no break statements.
functionThatCouldThrowOrExit();
// no break statements.
} |
I think he meant "or if the break is unreachable" as in:
Basically, don't be fooled just because there is a break statement if it can never get you out of the loop. |
This is a duplicate of a newer bug which has more information, #29196. |
Changes: ``` > git log --format="%C(auto) %h %s" ac7db6c..ec35d46 https://dart.googlesource.com/pub.git/+/ec35d462 Fix null-safety warning in dart.dart (#3514) https://dart.googlesource.com/pub.git/+/7d30cf0b Allow pubspec key 'funding' (#3529) https://dart.googlesource.com/pub.git/+/8ff63a8e Fix remaining usages of path.prettyUri on git uris (#3524) https://dart.googlesource.com/pub.git/+/bc32a30e Fix typo "exitcode" (#3511) ``` Diff: https://dart.googlesource.com/pub.git/+/ac7db6c07318efa4a8712110275eaf70f96a6d00~..ec35d46261b610e558dfd0d8525ca3fc8387b4b7/ Change-Id: I535f4fab8940ee8400ef75369d35fb4c1ee3adab Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255990 Reviewed-by: Sarah Zakarias <zarah@google.com> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
This reverts commit 78636aa. Reason for revert: This breaks the google3 roll. We need to roll frontend_server_client first. Original change's description: > Bump pub to ec35d46261b610e558dfd0d8525ca3fc8387b4b7 > > Changes: > ``` > > git log --format="%C(auto) %h %s" ac7db6c..ec35d46 > https://dart.googlesource.com/pub.git/+/ec35d462 Fix null-safety warning in dart.dart (#3514) > https://dart.googlesource.com/pub.git/+/7d30cf0b Allow pubspec key 'funding' (#3529) > https://dart.googlesource.com/pub.git/+/8ff63a8e Fix remaining usages of path.prettyUri on git uris (#3524) > https://dart.googlesource.com/pub.git/+/bc32a30e Fix typo "exitcode" (#3511) > > ``` > > Diff: https://dart.googlesource.com/pub.git/+/ac7db6c07318efa4a8712110275eaf70f96a6d00~..ec35d46261b610e558dfd0d8525ca3fc8387b4b7/ > Change-Id: I535f4fab8940ee8400ef75369d35fb4c1ee3adab > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255990 > Reviewed-by: Sarah Zakarias <zarah@google.com> > Commit-Queue: Sigurd Meldgaard <sigurdm@google.com> TBR=sigurdm@google.com,zarah@google.com Change-Id: I9f46b5a63f8c3f0b11a9fe1d348696b1f988e5ca No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256080 Reviewed-by: Sigurd Meldgaard <sigurdm@google.com> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com> Reviewed-by: Jonas Jensen <jonasfj@google.com>
This is a reland of commit 78636aa Original change's description: > Bump pub to ec35d46261b610e558dfd0d8525ca3fc8387b4b7 > > Changes: > ``` > > git log --format="%C(auto) %h %s" ac7db6c..ec35d46 > https://dart.googlesource.com/pub.git/+/ec35d462 Fix null-safety warning in dart.dart (#3514) > https://dart.googlesource.com/pub.git/+/7d30cf0b Allow pubspec key 'funding' (#3529) > https://dart.googlesource.com/pub.git/+/8ff63a8e Fix remaining usages of path.prettyUri on git uris (#3524) > https://dart.googlesource.com/pub.git/+/bc32a30e Fix typo "exitcode" (#3511) > > ``` > > Diff: https://dart.googlesource.com/pub.git/+/ac7db6c07318efa4a8712110275eaf70f96a6d00~..ec35d46261b610e558dfd0d8525ca3fc8387b4b7/ > Change-Id: I535f4fab8940ee8400ef75369d35fb4c1ee3adab > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255990 > Reviewed-by: Sarah Zakarias <zarah@google.com> > Commit-Queue: Sigurd Meldgaard <sigurdm@google.com> Change-Id: I9c50c7b5ea01fc24cc97b328766ad7d2b9c4b36e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256280 Reviewed-by: Sarah Zakarias <zarah@google.com> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
…t_channel, webdriver Revisions updated by `dart tools/rev_sdk_deps.dart`. dartdoc (https://github.com/dart-lang/dartdoc/compare/524b2b6..5156398): 5156398c 2023-10-09 Sam Rawlins Fix sidebar links for pub packages (#3510) 960bac41 2023-10-09 dependabot[bot] Bump ossf/scorecard-action from 2.2.0 to 2.3.0 (#3513) affc5b44 2023-10-08 Sam Rawlins Remove some old, unused options (#3511) c147aa19 2023-10-06 Sam Rawlins Fix left sidebar (#3507) mockito (https://github.com/dart-lang/mockito/compare/49859e4..47a5588): 47a5588 2023-10-06 Ilya Yanok Don't try to compare fakes to real objects 6b9eab9 2023-10-06 Ilya Yanok Undo the formatting fix 5ad2ff4 2023-10-05 Ilya Yanok Change default dummy value for `String` to contain some info 78c650b 2023-10-05 Ilya Yanok Use SDK 3.0.0 for stable tests adbe265 2023-10-04 Ilya Yanok Use 3.1.3 as stable SDK native (https://github.com/dart-lang/native/compare/fd21f5b..22f4481): 22f4481 2023-10-10 Daco Harkes [native_assets_builder] Fix pub warning in tests (#155) protobuf (https://github.com/dart-lang/protobuf/compare/c16bc89..c559fe5): c559fe5 2023-10-10 Ömer Sinan Ağacan Release protoc_plugin-21.1.2 (#881) 32ed0fe 2023-10-09 Ömer Sinan Ağacan Fix a bug in comment parsing (#879) test (https://github.com/dart-lang/test/compare/367aa39..4341470): 4341470a 2023-10-06 Nate Bosch Mention integration_test as an ignored directory (#2115) tools (https://github.com/dart-lang/tools/compare/f318c80..92c5c15): 92c5c15 2023-10-10 Devon Carew update to the latest package:dart_flutter_team_lints (#174) web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/364013d..f3ac1bf): f3ac1bf 2023-10-06 Nate Bosch Mention `ready` in the docs for `connect` (#287) webdriver (https://github.com/google/webdriver.dart/compare/21976d6..eaf9c58): eaf9c58 2023-10-05 Nate Bosch Spawn test server in a background isolate (#285) ccd01e5 2023-10-05 dependabot[bot] Bump actions/checkout from 3.6.0 to 4.1.0 (#284) f753b3e 2023-10-05 dependabot[bot] Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (#283) 6bd246f 2023-10-05 Devon Carew require dart 3.0; add publishing automation (#282) Change-Id: I83ec9986cc8acc60be76267c2d1127f237e2b5c3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329943 Auto-Submit: Devon Carew <devoncarew@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
while(true) {
...
}
gives no warning if the break statement is missing or unreachable.
////////////////////////////////////////////////////////////////////////////////////
Editor Version: 8124
The text was updated successfully, but these errors were encountered: