Closed
Description
In the review of #293, @lrhn pointed out that:
There is no easy way to make a
<functionFormalParameter>
nullable. I suggest:<functionFormalParameter> ::= \gnewline{} <metadata> \COVARIANT{}? <type>? <identifier> <formalParameterPart> `?'?
The final optional
?
would make the function type of the parameter into a nullable function type, so:E firstWhere(bool test(E element), {E orElse()?});would be valid.
When trying to convert dart:convert and dart:collection, I had a lot of optional function parameters which need to be nullable.
I'm filing this issue to track the decision about whether we want to make this change to the grammar, so that if we do, the analyzer team can find out about it and start work.