Closed
Description
The CFE accepts this code with no errors:
class A {
String operator+(int s) => null;
void set x(String s) {}
A get x => this;
}
void main() async {
var a = new A();
a.x++;
}
The analyzer rejects it with the following error messages:
error • The return type of getter 'x' is 'A' which isn't assignable to the type 'String' of its setter 'x' at /Users/leafp/tmp/test1.dart:10:9 • mismatched_getter_and_setter_types
error • The argument type 'int' can't be assigned to the parameter type 'String' at /Users/leafp/tmp/test1.dart:27:3 • argument_type_not_assignable
@eernstg Can you verify which behavior is consistent with the spec and then re-assign to the appropriate area and team?