[AST] Directly store GTPD in TypeValueExpr #79618
Merged
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.
Previously,
TypeValueExpr
stored a just builtTypeRepr
that we resolved in context in CSGen, but when we were in an extension context that concretized the generic parameter to something like123
, we would resolve it to this integer type instead of the archetype of that generic parameter. We relied on getting the archetype to return the underlying value type to treat the expression as, but with an integer type we are unable to retrieve that information back out. Instead, we always have the GTPD when making type value expressions (at least right now), so just store that directly and be a little less strict about requiring anArchetypeType
as our parameter type. AnIntegerType
is fine, SIL will properly optimize the instruction away if that's the case anyway.Resolves: rdar://144818205