Open
Description
class Foo {
const Foo(this.value);
final int? value;
}
class Bar extends Foo {
const Bar(int value)
: _value = value,
super(value);
final int _value;
@override
int get value => _value;
}
Bar
accepts only a value of type int
, while Foo
accepts int?
. The use_super_parameter
rule warns there although it is intentional that I've avoided super.value
so that the value
of Bar never becomes null.
It is possible to suppress the warning with the // ignore: use_super_parameter
comment, but it'll be better if the intention is considered. Is it too much for the analyzer to handle?