Skip to content

unused_import false positive for loadLibrary #47038

Open
@davidmorgan

Description

@davidmorgan

If an import is just used to call loadLibrary on a deferred library, the linter reports it as unused.

This is a false positive, it's used :)

import 'foo.dart' deferred as foo; // LINT (false positive)

void main() {
  foo.loadLibrary();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.customer-google3devexp-warningIssues with the analyzer's Warning codestype-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