Skip to content

Conversation

@slavapestov
Copy link
Contributor

We now compute captures of functions, closures and default arguments lazily, instead of as a side effect of primary file checking.

This fixes a specific issue with the -experimental-skip-* flags, where functions declared after a top-level guard statement are considered to have local captures, but nothing was forcing these captures to be computed.

Fixes rdar://problem/125981663.

@slavapestov slavapestov force-pushed the requestify-compute-captures branch from a609285 to 88baa45 Compare April 11, 2024 14:10
@slavapestov slavapestov requested a review from ktoso as a code owner April 11, 2024 14:10
@slavapestov slavapestov force-pushed the requestify-compute-captures branch from 88baa45 to d8cf028 Compare April 12, 2024 21:03
Copy link
Contributor

@tshortli tshortli left a comment

Choose a reason for hiding this comment

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

Nice!

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov force-pushed the requestify-compute-captures branch 2 times, most recently from d453149 to a1a07d8 Compare April 19, 2024 22:05
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov force-pushed the requestify-compute-captures branch from a1a07d8 to b778492 Compare April 20, 2024 12:39
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

We now compute captures of functions and default arguments
lazily, instead of as a side effect of primary file checking.

Captures of closures are computed as part of the enclosing
context, not lazily, because the type checking of a single
closure body is not lazy.

This fixes a specific issue with the `-experimental-skip-*` flags,
where functions declared after a top-level `guard` statement are
considered to have local captures, but nothing was forcing these
captures to be computed.

Fixes rdar://problem/125981663.
@slavapestov slavapestov force-pushed the requestify-compute-captures branch from b778492 to 55ff73f Compare April 21, 2024 02:16
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit ae9eeb0 into swiftlang:main Apr 21, 2024
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