Skip to content
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

[5.9] Remove a couple of over-eager assertions. #65190

Conversation

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Apr 14, 2023

Explanation: The best substitutions we can easily find in nested functions for captured local variables are the forwarding substitutions of the current environment. These should be fine for type-substitution purposes but do not necessarily match the generic signature of the original variable's environment, which can trip these assertions. Unfortunately, I can't think of an easy way to weaken these assertions sufficiently to cover this case.

This should fix the source-compat suite regression reported in rdar://107642925. 5.9 version of #65177.

Scope: When assertions are enabled, code that uses a captured local variable from a generic local function can fail an assertion. This showed up in the source compat suite
Issue: rdar://107642925, resolves #65200, resolves #65083.
Risk: Very low. Patch just removes the affected assertions
Testing: Added a regression test reduced from a file in the source compat suite

The best substitutions we can easily find in nested functions for
captured local variables are the forwarding substitutions of the
current environment.  These should be fine for type-substitution
purposes but do not necessarily match the generic signature of the
original variable's environment, which can trip these assertions.
Unfortunately, I can't think of an easy way to weaken these
assertions sufficiently to cover this case.

This should fix the source-compat suite regression reported in
rdar://107642925.
@rjmccall rjmccall requested a review from a team as a code owner April 14, 2023 17:20
@rjmccall
Copy link
Contributor Author

@swift-ci Please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
4 participants