Skip to content

unnecessary_import hint is not reported with single element import #49505

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

Closed
a14n opened this issue Jul 22, 2022 · 3 comments
Closed

unnecessary_import hint is not reported with single element import #49505

a14n opened this issue Jul 22, 2022 · 3 comments
Labels
devexp-warning Issues with the analyzer's Warning codes legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request

Comments

@a14n
Copy link
Contributor

a14n commented Jul 22, 2022

import 'a.dart' show A1;
import 'a.dart';

A1? a1 = null;
// A2? a2 = null;

In the code above, there should be an unnecessary_import warning on one of the 2 imports (likely the second line because the first line is more tighten).

Note that if we uncomment the last line a unnecessary_import warning appears on the first line.

$ dart --version
Dart SDK version: 2.17.5 (stable) (Tue Jun 21 11:05:10 2022 +0200) on "linux_x64"
@bwilkerson bwilkerson added legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request devexp-warning Issues with the analyzer's Warning codes labels Jul 22, 2022
@bwilkerson
Copy link
Member

@srawlins

@srawlins
Copy link
Member

Those two imports provide the same set of used elements. In this case one is redundant. The issue for reporting redundant imports is #44569.

@srawlins
Copy link
Member

Duplicate of #44569

@srawlins srawlins marked this as a duplicate of #44569 Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-warning Issues with the analyzer's Warning codes legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

3 participants