Skip to content

[CSClosure] Fix property wrapper handling #61052

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 2 commits into from
Sep 13, 2022

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Sep 12, 2022

  • Always pre-check init targets of wrapped vars

If a variable with attached property wrapper has an initializer
expression it could be modified by implicit wrapper application,
if there is no initializer - one would be synthesized by the
compiler (without arguments). In both cases target has to be
pre-checked before constraints are generated for it.

  • Use correct type for implicit wrapper variables

Using computeWrappedValueType is incorrect because
that return a type of the wrapped variable and not
the wrapper variable (one that starts with _).

Resolves: #61024
Resolves: #61017

Using `computeWrappedValueType` is incorrect because
that return a type of the wrapped variable and not
the *wrapper* variable (one that starts with `_`).

Resolves: swiftlang#61017
@xedin xedin requested a review from hborla September 12, 2022 20:06
@xedin
Copy link
Contributor Author

xedin commented Sep 12, 2022

@swift-ci please test

If a variable with attached property wrapper has an initializer
expression it could be modified by implicit wrapper application,
if there is no initializer - one would be synthesized by the
compiler (without arguments). In both cases target has to be
pre-checked before constraints are generated for it.

Resolves: swiftlang#61024
@xedin xedin force-pushed the closure-property-wrapper-fixes branch from 0473a80 to 61d3a9f Compare September 12, 2022 23:08
@xedin
Copy link
Contributor Author

xedin commented Sep 12, 2022

@swift-ci please test

Comment on lines +589 to +590
https://github.com/apple/swift/issues/61024
do {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a while to realize why this link compiles haha (statement label + comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants