The analyzer accepts the following code, but the CFE rejects it:
extension on Object? {
int get foo => 0;
}
test(void Function() f) {
f.foo = 0; // ERROR
}
The CFE is correct in rejecting the code; there is no .foo= setter defined for the type void Function().
A similar thing happens with the roles of the getter and setter reversed. Again, the analyzer accepts the code, but the CFE rejects it:
extension on Object? {
set foo(int value) {}
}
test(void Function() f) => f.foo; // ERROR
Again, the CFE is correct in rejecting the code.