Skip to content

Should unnecessary wildcard pattern be reported as a warning by all tools #52802

Open
@chloestefantsova

Description

@chloestefantsova

Consider the following program.

test(dynamic x) => switch(x) { int y && _ => 1, _ => 0 };

Currently it's accepted by the CFE, and the Analyzer emits the following warning.

  warning • Unnecessary wildcard pattern. • /tmp/asdf.dart:1:41 • unnecessary_wildcard_pattern 

I wasn't able to find that warning message in the specification, but I want to bring more agreement into how the tools report the errors. I created a CL to make the CFE report the same warning: https://dart-review.googlesource.com/c/sdk/+/311221

Should I land my CL? Should the spec be updated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    cfe-pendingCFE issues that need more information to be triaged.legacy-area-front-endLegacy: Use area-dart-model instead.type-questionA question about expected behavior or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions