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

False-negative for ambiguous_import #59590

Closed
FMorschel opened this issue Nov 22, 2024 · 1 comment
Closed

False-negative for ambiguous_import #59590

FMorschel opened this issue Nov 22, 2024 · 1 comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@FMorschel
Copy link
Contributor

While working on https://dart-review.googlesource.com/c/sdk/+/386020 I got the following (I'll post the relevant files):

  • lib.dart
class Random {}
  • root.dart
import 'dart:math'; // To test if this was never used
part 'level1_other.dart';
part 'level1.dart';
  • level1.dart
part of 'root.dart';
import 'dart:math';
import 'lib.dart';
part 'level2_other.dart';
part 'test.dart';
  • test.dart
part of 'level1.dart';
part 'level3_other.dart';

Random? r;

I was expecting the last line (Random? r;) to give out an ambiguous_import.

Tested with simply the following and it shows the same as above:

import 'dart:math'; // <-- unused_import
import 'lib.dart';

Random? r;

image

If I comment the import 'lib.dart'; line, nothing goes wrong.

image

@FMorschel FMorschel added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Nov 22, 2024
@FMorschel
Copy link
Contributor Author

Found #58326

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.
Projects
None yet
Development

No branches or pull requests

1 participant