Closed
Description
With --no-implicit-casts turned on, the analyzer currently makes the following an error:
class A {
void set f(int x) {}
Object get f => 3;
}
I believe this is an unintentional result of making assignable
asymmetric. The specification says that:
It is a static warning if a class has
a setter named \code{$v$=} with argument type $T$ and
a getter named $v$ with return type $S$,
and $S$ may not be assigned to $T$.
Turning on --no-implicit-casts essentially re-interprets "$S$ may not be assigned to
Do we want to treat this as a bug and fix it, or is this the right behavior for the post NNBD world.
In it's defense, this "bug" is enforcing the very sane property that a.f = a.f
should not be a type error.