Skip to content

[5.5][Property Wrappers] Fix a bug where wrapped arguments were not properly coerced to the wrapper generator input type. #38892

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

Merged
merged 4 commits into from
Aug 23, 2021

Conversation

hborla
Copy link
Member

@hborla hborla commented Aug 16, 2021

Cherry-pick of #38766

This is important for 5.5 because it fixes a SILGen crash.


For wrapped parameters that are initialized at the call-site (i.e. property wrappers with init(projectedValue:)), the argument needs to be coerced to the wrapper generator input type in CSApply. Otherwise, this leads to a SILGen crash.

This change also fixes a bug where @autoclosure was not properly propagated from init(wrappedValue:) to a wrapped argument because the property wrapper initializer was built manually in PropertyWrapperInitializerInfoRequest instead of going through SolutionApplicationTarget::maybeApplyPropertyWrapper() which handles @autoclosure injection around the initial wrapped value for regular wrapped properties.

Resolves: rdar://80820408 / SR-14927

hborla added 4 commits August 16, 2021 10:26
…tween

wrapped parameters and wrapped properties.

This fixes a bug where @autoclosure was not propagated from the wrapper's
init(wrappedValue:) to a wrapped argument.
@hborla hborla requested a review from a team as a code owner August 16, 2021 17:29
@hborla
Copy link
Member Author

hborla commented Aug 16, 2021

@swift-ci please test

1 similar comment
@hborla
Copy link
Member Author

hborla commented Aug 23, 2021

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 203c304

@hborla
Copy link
Member Author

hborla commented Aug 23, 2021

@swift-ci please test Linux platform

@hborla hborla merged commit a5d8c33 into swiftlang:release/5.5 Aug 23, 2021
@hborla hborla deleted the 5.5-wrapped-argument-conversions branch August 23, 2021 23:02
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