Skip to content

Don't allow "ignore:" to suppress errors #27218

Closed
@stereotype441

Description

@stereotype441

The "ignore:" syntax was intended to allow users to suppress warnings, hints, and lints; and nearly all cases that is how it is used. However, it currently allows errors to be suppressed as well. This creates the risk that genuine errors will creep into users' code bases due to inadvertent use of "ignore:". We would like to change the behavior of "ignore:" so that it cannot suppress errors.

Note that before we can fix this we must address #26980 (since Flutter is currently using the "ignore:" syntax to work around that issue). To work around this issue, we plan to change analyzer's behavior to match the VM's (so that enums may be equality compared inside constants). The issue will remain open, since the spec either needs to be updated to match this behavior, or we need to change the VM and analyzer to disallow it and find a different way to meet Flutter's needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.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