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

[CSApply] Avoid shortcutting argument conversion when parameter has a… #77816

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Nov 22, 2024

…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

…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
@xedin
Copy link
Contributor Author

xedin commented Nov 22, 2024

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a 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)) {
Copy link
Contributor

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

Copy link
Contributor Author

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...

Copy link
Contributor

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

@xedin
Copy link
Contributor Author

xedin commented Nov 22, 2024

@swift-ci please test

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.

3 participants