Closed sgrekhov closed 4 years ago
I think the fix for improved display of types was landed just a day or two ago, but it's possible that these cases were not covered by that CL. @scheglov Could you check?
I'm not sure when exactly this was fixed - some time ago, or yesterday when I did another pass over using DartType.getDisplayString(withNullability)
instead of DartType.toString()
. Anyway, the bleeding edge now report for the first example:
error: 'C.i=' ('void Function(int)') isn't a valid override of 'A.i=' ('void Function(int?)'). (invalid_override at [test] bin/test.dart:5)
And for the second example:
error: 'C.i' ('int? Function()') isn't a valid override of 'A.i' ('int Function()'). (invalid_override at [test] bin/test.dart:5)
An expected error message is
error - 'C.i=' ('void Function(int)') isn't a valid override of 'A.i=' ('void Function(int?)'). - override_checking_A02_FIELD_t02.dart:118:7 - invalid_override
And vice versa example
An expected error is
error - 'C.i' ('int? Function()') isn't a valid override of 'A.i' ('int Function()'). - override_checking_A02_FIELD_t02.dart:117:8 - invalid_override
dartanalyzer version 2.8.0-dev.0.0