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.
Not referencing any issues, just wanted to see if this works
Generalizes the logic from #18631 to all post expr blocks and definitions that support macro pragmas, which considers them "tail args", i.e. matched to the end of the overload params rather than the start, as long as the argument at that position has to be provided (no varargs, void, or params with default values).
Then it's checked that every argument before them is provided or doesn't need to be provided (i.e. varargs, default value) and the match fails if they aren't. This prevents post expr blocks and macro pragmas from needlessly getting typechecked when enough arguments aren't given for their overload. Restricting to post expr blocks and macro pragmas here is because they have a
void
type at syntax level, so it's not important that they get typechecked earlyThis solves the issues referenced in #21673 but only for post-expr blocks and macro pragmas.