Skip to content

[AST] Directly store GTPD in TypeValueExpr #79618

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
Feb 26, 2025

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Feb 25, 2025

Previously, TypeValueExpr stored a just built TypeRepr that we resolved in context in CSGen, but when we were in an extension context that concretized the generic parameter to something like 123, 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 an ArchetypeType as our parameter type. An IntegerType is fine, SIL will properly optimize the instruction away if that's the case anyway.

Resolves: rdar://144818205

@Azoy
Copy link
Contributor Author

Azoy commented Feb 25, 2025

@swift-ci please smoke test

@Azoy Azoy merged commit acbae0c into swiftlang:main Feb 26, 2025
3 checks passed
@Azoy Azoy deleted the another-bug-another-dollar branch February 26, 2025 15:59
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.

1 participant