Due to new informations I think we can continue this conversation.
@John_McCall said:
It should be quite straightforward to extend escape analysis to optional parameter functions and allow them to be explicitly marked as
@escaping
or@nonEscaping
(or however we want to spell that). We can also investigate changing the default language rule for optional parameter functions so that it's consistent for different optionalities, but that's a separable question.
So, the take away from that parallel pitch is that we can teach the compiler to understand that optional values can propagate escapability.
I updated the original post with the new info.