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

Flag if (A) { B } else if (A) { C } #57273

Closed
filiph opened this issue Feb 16, 2016 · 4 comments
Closed

Flag if (A) { B } else if (A) { C } #57273

filiph opened this issue Feb 16, 2016 · 4 comments
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. linter-lint-request type-enhancement A request for a change that isn't a bug

Comments

@filiph
Copy link
Contributor

filiph commented Feb 16, 2016

  if (aSource.mType == NS_STYLE_CLIP_PATH_URL) {
    SetURL(aSource.mURL);
  } else if (aSource.mType == NS_STYLE_CLIP_PATH_SHAPE) {
    SetBasicShape(aSource.mBasicShape, aSource.mSizingBox);
  } else if (aSource.mType == NS_STYLE_CLIP_PATH_SHAPE) {
    SetSizingBox(aSource.mSizingBox);
  }

Seems to be another common copy-paste error.

@pq pq added type-enhancement A request for a change that isn't a bug linter-lint-request labels Feb 17, 2016
@dikmax
Copy link

dikmax commented Nov 28, 2016

I think this one is implemented in invariant_boolean rule (#229) and can be closed.

@bwilkerson
Copy link
Member

@alexeieleusis Can you confirm that this case is covered?

@alexeieleusis
Copy link
Contributor

It is linted with the specified rule, tested with the following snippet:

void nestedOk4_1() {
  if (foo <= bar) {
    return;
  } else if (foo <= bar) { // LINT
    print('hola mundo!');
  } else if (foo <= bar) { // LINT
    print('hello world!');
  }
}

Should we add it as a test case?

@bwilkerson
Copy link
Member

If there isn't already a test to test this case, that would be a good idea, but there's no point in testing it twice.

@devoncarew devoncarew added analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. linter-lint-request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants