-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[CS] A couple of property wrapper fixes #85193
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
Conversation
|
@swift-ci please test |
|
@swift-ci please test source compatibility |
155324f to
969d745
Compare
And make sure we mark any PatternBindingDecl entries as having been checked to avoid re-checking. This fixes a crash where we could attempt to re-check a property wrapper to compute its backing type.
Rather than computing these each time we need to solve an element that has a reference to them, let's just set them up-front when we generate constraints for the corresponding variable.
These methods can be simplified a bunch since the returned decl is always the input decl and we can refactor the lambdas to just return the auxiliary variable and have the type computation in the caller.
Make sure we query the constraint system for a type if we have a local property wrapper in a closure to avoid kicking interface type computation outside the closure, and make sure we map into context if we need to.
969d745 to
260d10f
Compare
|
@swift-ci please smoke test |
xedin
left a comment
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.
LGTM, thank you!
| if (!var) | ||
| return Action::Continue(expr); | ||
|
|
||
| if (auto *wrappedVar = var->getOriginalWrappedProperty()) { |
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'm trying to remember why I did it this way and failing, we might have done something differently back then...
Clean up a bit of property wrapper logic in the constraint system and fix a couple of crashers.