Skip to content

False-negative for ambiguous_import #59590

@FMorschel

Description

@FMorschel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions