Skip to content

[Windows]: explicitly set closure captures #60647

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 1 commit into from
Aug 19, 2022

Conversation

etcwilde
Copy link
Member

MSVC isn't seeing that CheckDefaultInitializer is declared and being
implicitly captured by reference by the closure going into the
forEachVariable.
Capturing HasStorage and CheckDefaultInitializer explicitly.

MSVC isn't seeing that `CheckDefaultInitializer` is declared and being
implicitly captured by reference by the closure going into the
`forEachVariable`.
Capturing `HasStorage` and `CheckDefaultInitializer` explicitly.
@etcwilde etcwilde requested a review from compnerd August 19, 2022 16:26
@etcwilde
Copy link
Member Author

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Can't tell if this is brilliant or horrible. The declaration should be the function scope, not the call scope, but limiting the lambda to the call scope is an interesting way (and reduces potential size of the closure).

@etcwilde
Copy link
Member Author

It's most definitely horrible. MSVC should be able to see that those variables are declared right there. If you know of another way to communicate that, I'm all ears.

@etcwilde etcwilde merged commit dc8cdcb into swiftlang:main Aug 19, 2022
@etcwilde etcwilde deleted the ewilde/explicit-closure-captures branch August 19, 2022 20:48
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