-
Notifications
You must be signed in to change notification settings - Fork 225
starlark: check for duplicate kwarg keys in dict #63
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
Conversation
Oops. Do not review. This fix is in the wrong place. |
PTAL |
Note that doing bazelbuild/starlark#21 will render this unnecessary. |
I don't think it's unnecessary in all cases. A call to dict or dict.update should not have repeated keys either statically (as in bazelbuild/starlark#21) or dynamically, as in this PR. Two separate checks are required. All other built-ins either don't accept keyword args, or call UnpackArgs, which performs the dynamic check. All Starlark defined functions have the check in setArgs. dict and dict.update are unusual in they are built-ins that accept keyword args but don't use UnpackArgs. |
Oh right, I forgot about the mixed static and dynamic kwargs case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your diligence here. I think this change will be necessary exactly as it is even if we implement a static check for repeated keyword args in a call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
All done; thanks for the review. |
Fixes #55