Skip to content

AST: Fix crash when type parameter is fixed to an existential #81913

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
Jun 3, 2025

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jun 2, 2025

getContextSubstitutionMap() didn't handle the case where getAnyNominal() returns a ProtocolDecl. This should not take the "fast path", which is only suitable for concrete nominals.

This manifested as a crash-on-invalid -- the user probably meant to write "T.Value: Collection" rather than "T.Value == Collection".

Fixes rdar://151479861.

@slavapestov slavapestov requested a review from hborla as a code owner June 2, 2025 21:32
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

getContextSubstitutionMap() didn't handle the case where getAnyNominal()
returns a ProtocolDecl. This should not take the "fast path", which is
only suitable for concrete nominals.

This manifested as a crash-on-invalid -- the user probably meant to write
"T.Value: Collection" rather than "T.Value == Collection".

Fixes rdar://151479861.
@slavapestov slavapestov requested a review from xedin as a code owner June 2, 2025 23:19
@slavapestov slavapestov changed the title RequirementMachine: Fix crash when type parameter is fixed to an existential AST: Fix crash when type parameter is fixed to an existential Jun 2, 2025
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov enabled auto-merge June 3, 2025 02:59
@slavapestov slavapestov merged commit 10f0f61 into swiftlang:main Jun 3, 2025
3 checks passed
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