Skip to content

[IDE] Fix code completion crash after already-typechecked ApplyExpr #26723

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

Conversation

nathawes
Copy link
Contributor

This was due to us unconditionally setting the referenced decl to be the decl referenced by the ApplyExpr's function, when we should only do that for SelfApplyExprs. This caused a crash for calls returning a function type due to a mismatch between the arity of expression's type (the function type the applied function returns) and the referenced decl (the signature of the applied function itself).

Resolves rdar://problem/53034130.

@nathawes
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b7d680554303e4c44b14f961de162492eb4936fe

@nathawes nathawes force-pushed the r54047322-fix-completion-crash-in-addFunctionCallPattern branch from b7d6805 to d68f669 Compare August 19, 2019 19:33
@nathawes
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b7d680554303e4c44b14f961de162492eb4936fe

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b7d680554303e4c44b14f961de162492eb4936fe

This was due to us unconditionally setting the referenced decl to be the decl
referenced by the ApplyExpr's function, when we should only do that for
SelfApplyExprs. This caused a crash for calls returning a function type due to
a mismatch between the resulting type (the function type the applied function
returns) vs the referenced decl signature (the signature of the applied
function itself).

Resolves rdar://problem/53034130.
@nathawes nathawes force-pushed the r54047322-fix-completion-crash-in-addFunctionCallPattern branch from d68f669 to 7bcba14 Compare August 19, 2019 21:06
@nathawes
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d68f66996ad4af4ab550388f57368c927f411ef7

@nathawes nathawes requested a review from rintaro August 19, 2019 21:08
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d68f66996ad4af4ab550388f57368c927f411ef7

@nathawes nathawes marked this pull request as ready for review August 19, 2019 22:35
Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

Thank you Nathan!

@nathawes nathawes merged commit bebc27f into swiftlang:master Aug 20, 2019
@nathawes nathawes deleted the r54047322-fix-completion-crash-in-addFunctionCallPattern branch August 20, 2019 16:29
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.

3 participants