Skip to content

Not clear if @visibleForTesting elements should be visible in other packages #60731

@sigurdm

Description

@sigurdm

https://api.flutter.dev/flutter/meta/visibleForTesting-constant.html says

Tools, such as the analyzer, can provide feedback if

  • ...
  • the declaration is referenced outside of its defining library or a library which is in the test folder of the defining package.

But the analyzer doesn't warn if an element is used in a test from another package.

It is not clear if the documentation or the analyzer is wrong here. I think both interpretations are useful in some cases.

Maybe we even need two different annotations

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.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