-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[SE-0365] Fix #64757: Unexpected "Implicit use of 'self' in closure" error in closure nested in result builder #64786
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
|
@calda I looked at the example under |
|
@ahoppen Looks like this is the issue here https://github.com/apple/swift/blob/main/lib/Sema/ConstraintSystem.cpp#L7112. Should this be set only in code completion mode? |
|
@calda I haven't looked at where this flag gets set but I was hoping that this check you added code be moved there so we end up without this option if solver is not in code completion mode... |
|
Thanks @xedin, that makes sense. I moved the change up to the callsite of the method that configures that option. All the tests pass still with this change. |
|
@ahoppen WDYT? |
|
@swift-ci please test |
lib/Sema/TypeCheckStmt.cpp
Outdated
| func, builderType)) { | ||
| func, builderType, | ||
| /*ClosuresInResultBuilderDontParticipateInInference=*/ | ||
| false)) { |
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.
@ahoppen Should we flip default to false maybe instead?
|
@calda Could you please switch default to |
|
@swift-ci Please SourceKit stress test |
|
@swift-ci please test |
This PR fixes an issue with the implementation of SE-0365, where the following code would unexpectedly emit an error:
Fixes #64757, fixes #71040.
Please review: @xedin