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

[augmentations] Wrong analyzer warning when augmenting enum constructor #57028

Open
sgrekhov opened this issue Nov 5, 2024 · 0 comments
Open
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P2 A bug or feature request we're likely to work on

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Nov 5, 2024

The code below produces a warning in the analyzer (with --enable-experiment=macros).

enum E {
  e0(0), e1.foo();
  final int x;
  const E(this.x);
  const E.foo(): this(1); //  The declaration 'E.foo' isn't referenced. Try removing the declaration of 'E.foo'. • unused_element
}

augment enum E {
  e2(1);
  augment const E.foo();
}

main() {
  print(E.e1);
}

E.foo() is referenced here so the warning is wrong.

Dart SDK version: 3.7.0-86.0.dev (dev) (Wed Oct 30 17:03:22 2024 -0700) on "windows_x64"

@sgrekhov sgrekhov added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature labels Nov 5, 2024
@sgrekhov sgrekhov changed the title [augmentations] Wrong anallyzer warning when augmenting enum constructor [augmentations] Wrong analyzer warning when augmenting enum constructor Nov 5, 2024
@scheglov scheglov added the P2 A bug or feature request we're likely to work on label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

2 participants