Skip to content

Import name conflicts: Suggest adding "hide" on one of the conflicting imports #56255

Closed
@rrousselGit

Description

@rrousselGit

Consider:

// a.dart
class Foo {}

// b.dart
class Foo {}

// c.dart
import 'a.dart';
import 'b.dart';

void main() {
  Foo(); // Conflict, defined in both `a.dart` and `b.dart`
}

Going through imports to manually add that hide Foo; on the relevant import is tedious.

Could we add a quick fix for it? When applied on Foo(), it could suggest:

  • Add hide Foo to import 'a.dart'
  • Add hide Foo to import 'b.dart'

Supporting static extensions conflicts too would be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestdevexp-quick-fixIssues with analysis server (quick) fixeslegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions