-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[ASTGen] Generate CaptureListExpr #79416
Conversation
9deaa80
to
5376bc1
Compare
parameters: BridgedArrayRef(), | ||
rightParenLoc: nil | ||
) | ||
result.params = nil |
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.
Creating empty parameter list here was a mistake. generate(closureExpr:)
will synthesize anonymous closure parameter list according to the $n
usages.
5376bc1
to
c6e94b6
Compare
Move the capture list entry construction logic to CaptureListEntry::createParsed() so that ASTGen can use it.
c6e94b6
to
84875d1
Compare
@swift-ci Please smoke test |
@swift-ci Please smoke test Linux |
let captures = node.items.lazy.map { node in | ||
self.generate(closureCapture: node) | ||
self.generate(closureCapture: node, capturedSelfDecl: &result.capturedSelfDecl) |
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.
Using an inout
argument in a lazy transform feels like it has the potential to be a footgun, though I guess it doesn't really matter in practice given we know bridgedArray
immediately iterates in order
Move the capture list entry construction logic to
CaptureListEntry::createParsed()
so that ASTGen can use it.