Skip to content

Private declarations show in extract and diff #228

@FMorschel

Description

@FMorschel

Describe the bug
If you write a declaration in Dart where the name starts with _, it is private to that library and can't be accessed outside - we also have unnamed extensions but I've not checked those. They are showing in both diff and extract commands.

To Reproduce
Write a Dart file:

class _MyPrivateClass{}

// Maybe test these too
extension on int {
  String get foo => 'foo';
}

bool _foo => false;

You can't access either from outside this file (only with parts).

Actual and Expected behavior

For the private declarations not to show.

System info (please complete the following information):

  • Dart SDK version: 3.9.0-edge.d3c323e26d1663ab422ff89b65d5a78b0e89c997 (main) (Sun Jul 6 22:55:04 2025 -0700) on "windows_x64"
  • dart_apitool version 0.21.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions