-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[CSApply] Avoid shortcutting argument conversion when parameter has a… #77816
base: main
Are you sure you want to change the base?
[CSApply] Avoid shortcutting argument conversion when parameter has a… #77816
Conversation
…n external property wrapper The check to see whether argument matches the parameter exactly causes two problems: prevents projected value initialized injection; and, if there are multiple parameters with property wrappers, would apply incorrect wrapper to other locations because the wrapper application index wasn't incremented. Resolves: rdar://140282980
@swift-ci please test |
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.
Looks great, thank you!
auto paramType = param.getOldType(); | ||
if (argType->isEqual(paramType) && !shouldInjectWrappedValuePlaceholder) { | ||
|
||
if (canShortcutConversion(argType, paramType)) { |
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.
I do wonder if could do away with this short-circuiting altogether, seems like too easy of a footgun and I'm not sure it's buying us much
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.
Yeah, that's what I was thinking as well, I just think it might be worth doing that separately...
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.
Oh yeah definitely, doesn't have to be this PR
…operty wrappers are used
@swift-ci please test |
…n external property wrapper
The check to see whether argument matches the parameter exactly causes two problems:
prevents projected value initialized injection; and, if there are multiple parameters with property
wrappers, would apply incorrect wrapper to other locations because the wrapper application
index wasn't incremented.
Resolves: rdar://140282980