Skip to content
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

[CodeCompletion] Fix crash when completing in arguments of unresolved pattern inside closure #74083

Closed
wants to merge 1 commit into from

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 2, 2024

rdar://128661960

@ahoppen
Copy link
Member Author

ahoppen commented Jun 2, 2024

@swift-ci Please smoke test

Comment on lines +704 to +705
if (hasType(fnExpr)) {
if (auto *loc = getSpecialFnCalleeLoc(getType(fnExpr))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right, getType is a function being passed into getCalleeLocator whereas hasType is the ConstraintSystem member; you'd need to plumb through a separate hasType function. That being said I'm curious why the type wouldn't be set here 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

@ahoppen I dug into this a bit and discovered it's because we're re-creating the ExprPattern along different solver paths, put up #74387 to fix that which should mean we don't have to do this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you! ⭐

@ahoppen ahoppen closed this Jun 14, 2024
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