Bring back support for optional types in constructors #366
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #353, adding
_parenthesized_type
caused new parse failures where the parser now resolved away fromtuple_type
too early. Specifically, when parsing an expression like[(any Foo) ...
, thetuple_type
interpretation must still be valid at that point in the expression in case we're about to see a?
.The truly robust thing to do would be to support
$.tuple_type
as the target of the navigation expression. However, this leads to a large number of additional parse failures, as seen in #360. To avoid all of that, we add support in the opposite direction: allowtuple_type
to be resolved using_parenthesized_type
, so that the parser seeing the latter does not cause it to invalidate the former.