Skip to content

Avoid private types in public API #58350

@goderbauer

Description

@goderbauer

Public API should not reference any private types that may not be accessible to the caller.

Examples

typedef _Foo = int Function(String);

class _Bar { }

// lint warning on the next line that _Bar and _Foo are private types while doSomething is public API.
void doSomthing(_Bar bar, _Foo foo) {
  // ...
}

/cc @pq @Hixie @mit-mit @munificent @devoncarew

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions