Skip to content

[5.5][SILGen] Fix a couple bugs with wrapped parameters in initializers. #39121

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 5 commits into from
Sep 2, 2021

Conversation

hborla
Copy link
Member

@hborla hborla commented Sep 1, 2021

Cherry-pick of #38854

This is important to take for 5.5 because it fixes a SILGen crash and bogus error messages.


Attempting to use wrapped parameters in initializers would lead to a SILGen crash or a bogus error message because the local auxiliary decls for wrapped parameters were never emitted. Fix this by recording local auxiliary decls when the parameter is emitted, and emit those auxiliary decls before the body statements in StmtEmitter::visitBraceStmt.

Resolves: rdar://81560448, SR-15033

emit those auxiliary decls inside the function body brace statement.

This generalizes the old code to work for parameters to any kind of
function (e.g. initializers).
…ameters

with external property wrappers.

Otherwise, the code will attempt to forward the wrapped value type to a
function that accepts the property wrapper type.
…kind

to none when default arguments are not inherited.
@hborla hborla requested a review from a team as a code owner September 1, 2021 18:08
@hborla
Copy link
Member Author

hborla commented Sep 1, 2021

@swift-ci please test

@hborla
Copy link
Member Author

hborla commented Sep 1, 2021

@swift-ci please test source compatibility

@hborla
Copy link
Member Author

hborla commented Sep 1, 2021

@swift-ci please test Windows platform

@hborla hborla merged commit 43aaf29 into swiftlang:release/5.5 Sep 2, 2021
@hborla hborla deleted the 5.5-wrapped-param-in-init branch September 2, 2021 04:39
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