Skip to content

[ConstraintSystem] Dependent member simplification should be attempte… #63947

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 28, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 27, 2023

…d if it has type variable in any position

Current logic attempts simplification of the base type only if it's a type variable or a dependent member type. That's valid for correct code but not for invalid code e.g. (($T) -> Void).Element is not going to be simplified even if $T is bound, which causes crashes in diagnostic mode because matchTypes is going to re-introduce constraint with partially resolved dependent member types and by doing so make it stale forever which trips constraint system state verification logic.

Resolves: rdar://105149979

…d if it has type variable in any position

Current logic attempts simplification of the base type only if it's
a type variable or a dependent member type. That's valid for correct
code but not for invalid code e.g. `(($T) -> Void).Element` is not
going to be simplified even if `$T` is bound, which causes crashes
in diagnostic mode because `matchTypes` is going to re-introduce
constraint with partially resolved dependent member types and by
doing so make it stale forever which trips constraint system state
verification logic.

Resolves: rdar://105149979
@xedin
Copy link
Contributor Author

xedin commented Feb 27, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 27, 2023

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Feb 27, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 27, 2023

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Feb 27, 2023

@swift-ci please test source compatibility

@xedin xedin merged commit 08e62a3 into swiftlang:main Feb 28, 2023
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.

2 participants