Skip to content

[CSSolver] Fix a crash in diagnostics related to pattern matching #65366

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 4 commits into from
Apr 24, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Apr 21, 2023

repairFailures code for sequence element type attempts to assign placeholders to pattern type directly but it didn't check whether type variables that appear in it are already bound (repairFailures is called from matchTypes that doesn't fully simplify involved types). Adjusting that fixes the crash but results in sub-par diagnostic because type of is pattern wasn't allowed to be bound to a hole which means that placeholders cannot be propagated from the sequence element type down into associated pattern in this case.

Resolves: #65360

@xedin xedin requested a review from hborla as a code owner April 21, 2023 19:14
@xedin
Copy link
Contributor Author

xedin commented Apr 21, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Apr 21, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Apr 21, 2023

@swift-ci please test

Introduce `ConstraintSystem::recordTypeVariablesAsHoles` as a
standard way to record that unbound type variables found in a
type are holes in the given constraint system.
@xedin
Copy link
Contributor Author

xedin commented Apr 21, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Apr 21, 2023

@swift-ci please test

Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, super quick fix!

@xedin
Copy link
Contributor Author

xedin commented Apr 24, 2023

@swift-ci please test

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.

ConstraintSystem crash in multi-statement closure: "Already has a fixed type!"
3 participants