Analyzer's printing of function types will need to change to support nullability #35818
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
The Dart syntax for function types takes the form
returnType Function(parameters)
, but the analyzer reports function types (e.g. in diagnostic messages) using the terser syntax(parameters) → returnType
. With the introduction of non-nullability, this will leads to an ambiguity: does(parameters) → returnType?
mean that the return type is nullable, or that the entire function is nullable?We should either adapt the display of function types to disambiguate with parentheses, or switch to using
Function
syntax.The text was updated successfully, but these errors were encountered: