Skip to content

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Oct 4, 2024

refs status-im/nimbus-eth1#2684 (comment)

In overload disambiguation, the entire proc types of the overloads are compared to each other, including the types of parameters that aren't in the original call. To fix this, we make the "specificity" value of inserted params like default values or empty varargs equal to 0, which acts as if they weren't there at all.

To check for inserted params the nfDefaultParam node flag is used, and now empty varargs generated at the end of the match is also marked as nfDefaultParam. We could rename this to nfInsertedParam, but updateDefaultParams had to be changed to a way that happens to work with varargs (checking if the param has a default value, only works because varargs can't have default values), so it's not necessarily that general.

An alternative is to track the insertedness of arguments as an array inside TCandidate, as an enum with values like NotInserted, InsertedDefaultParam, InsertedVarargs, in which case we don't need nfDefaultParam at all. Let me know if this should be done instead.

Copy link
Contributor

github-actions bot commented Oct 5, 2025

This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Staled PR/issues; remove the label after fixing them label Oct 5, 2025
@Araq
Copy link
Member

Araq commented Oct 7, 2025

I don't see how that's intuitive behavior. IMO it's pretty much guesswork here for the programmer.

@Araq Araq removed the stale Staled PR/issues; remove the label after fixing them label Oct 7, 2025
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.

2 participants