Skip to content

Ignore dead code warning in preparation for flow analysis improvement. #465

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

Merged
merged 2 commits into from
Dec 17, 2020

Conversation

stereotype441
Copy link
Contributor

When dart-lang/language#1274 (Infer
non-nullability from local boolean variables) is implemented, flow
analysis will detect that code like this is unreachable:

bool hasArguments = false;
...
if (hasArguments) {
  // Not reachable
}

To prepare for this improvement, we need to add an "ignore" comment to
ignore the dead_code warning that will be generated.

When dart-lang/language#1274 (Infer
non-nullability from local boolean variables) is implemented, flow
analysis will detect that code like this is unreachable:

    bool hasArguments = false;
    ...
    if (hasArguments) {
      // Not reachable
    }

To prepare for this improvement, we need to add an "ignore" comment to
ignore the dead_code warning that will be generated.
@@ -159,7 +159,7 @@ class PictureConfiguration {
result.write('PictureConfiguration(');
bool hasArguments = false;
if (bundle != null) {
if (hasArguments) {
if (hasArguments) { // ignore: dead_code
Copy link
Owner

Choose a reason for hiding this comment

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

But this isn't dead. Ok the subsequent iteration it's used.

Copy link
Owner

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

My mistake this was probably a copy paste error or something I mistakenly thought was in a loop

@dnfield
Copy link
Owner

dnfield commented Dec 17, 2020

Ci failure is the coveralls issue which I really need to fix at some point. Tests are passing.

@dnfield dnfield merged commit 4e30923 into dnfield:master Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants