Skip to content

Unclear documentation of @internal #60732

Open
@sigurdm

Description

@sigurdm

https://pub.dev/documentation/meta/latest/meta/internal-constant.html says

Tools, such as the analyzer, can provide feedback if

the declaration is declared in a package's public API, or is exposed from a package's public API, or
the declaration is private, an unnamed extension, a static member of a private class, mixin, or extension, a value of a private enum, or a constructor of a private class, or
the declaration is referenced outside the package in which it is declared.

It seems the last line kind of contradicts the two others. That case should only happen if the other ones are not upheld.

Also it seems the analyzer only reports about top-level @internal elements being exported.

// lib/src/a.dart
import 'package:meta/meta.dart';

@internal // This causes warning
class Exported {
  @internal // this does not
  void shouldNotBeExported() {}
}

// lib/main.dart
export 'src/a.dart'; // Warning is issued here

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.devexp-pkg-metaIssues related to package:metatype-documentationA request to add or improve documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions