Closed
Description
I recently ran into dart-lang/language#2911 and this seems like a good candidate to add to the recommended set. It's probably something users want more often than not.
Metadata
Metadata
Assignees
Type
Projects
Status
No status
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]Add "type_literal_in_constant_pattern"[/-][+]Add `type_literal_in_constant_pattern`[/+]lrhn commentedon Sep 19, 2023
I'd really want this warning to be enabled by default in the analyzer, if at all possible.
Even if it's just as a "hint".
Otherwise, I'd put it in
core
. It's warning about a highly error-prone pattern, and I'd prefer knowing that packages I depend on are aware of the pitfall, and have taken steps to avoid it.devoncarew commentedon Sep 19, 2023
This is approved for the
core
set.Fernandomr88 commentedon Oct 23, 2023
so I have a function that basically is this
which is called like
get<Person>();
and by using the notation suggested by this rule (
Person _
), it stopped working.How am I supposed to change my code to be adequate to this linter rule?
bwilkerson commentedon Oct 23, 2023
It sounds like the rule might need to be changed to not produce a diagnostic if the value being switched over is
Type
.