Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tail args experiment #24555

Draft
wants to merge 3 commits into
base: devel
Choose a base branch
from
Draft

tail args experiment #24555

wants to merge 3 commits into from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Dec 20, 2024

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 early

This solves the issues referenced in #21673 but only for post-expr blocks and macro pragmas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant