Open
Description
Repro:
// ignore_for_file: unused_local_variable
class Foo {
num? foo;
num bar = 0;
}
void foo(Foo f) {
if (f case Foo(:num foo?, :var bar?,)) {}
}
The second ?
inside the pattern match triggers unnecessary_null_check_pattern
but not the first. I'd say that since we are testing for the explicit num
(non-nullable type), it should trigger, too.