Sema: Fix ASTPrinter and opened element environments to handle nested pack expansion types [5.9] #67310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: In a couple of places we incorrectly decided that a same-type requirement
T.A == G<repeat each U>
(where T.A is a scalar type) was a pack requirement, as if we were expanding the entire requirement across theeach U
. The ASTPrinter would prefix the requirement withrepeat
, and creating element archetypes would do the wrong thing and crash. Fix these places to correctly handle nested pack expansion types so that pack references bound by those expansions are not considered.Radar: rdar://112108253
Reviewed by: @hborla