Skip to content

Use imported library with prefix (remove hide/add show) adds new prefix to useΒ #57090

@FMorschel

Description

@FMorschel

After #54786 was closed, we now have a bug in the following code when using the assist:

file.dart:

class A {}

main.dart

import 'file.dart' as f hide A;

void foo(l.A a) {} // <-- Use imported library with prefix...

Currently adds a new prefix so at that line we end up with void foo(l.l.A a) {}.


Also, prefix-related, I think this could probably be fixed together. If the code was instead:

import 'file.dart' as f hide A; // Uneeded for the explanation but a reason for the prefix later in the file
import 'file.dart' hide A;

void foo(l.A a) {} // <-- Update library import

It removes the hide A but it doesn't look whether there is a prefix on the element. I'm unsure if this suggestion should be suppressed or if we should remove the prefix (preferred) in that case (there is no suggestion if the hide A or a show is not present at the import).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions