Skip to content

[5.5][CodeComplete] Fall back to typechecking a single expression result builder doesn't typecheck #37757

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

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 3, 2021

Cherry-picks #37709 to release/5.5.


If a result builder body fails to typecheck, we currently don't provide any code completion results at all. Instead, try to recover by type checking the expression in the result builder that contains the code completion token, on its own.

I know this is a bit of a hack and that we might be missing some information about contextual types, but IMHO this is preferable than not providing any results at all.

Resolves rdar://78015510

ahoppen added 2 commits June 3, 2021 07:23
…uilder doesn't typecheck

If a result builder body fails to typecheck, we currently don't provide any code completion results at all. Instead, try to recovery by type checking the expression in the result builder that conatins the code completion token on its own. This might be missing some information about contextual types but is preferrable over not providing any results at all.

Resolves rdar://78015510
@ahoppen ahoppen added the r5.5 label Jun 3, 2021
@ahoppen ahoppen requested a review from akyrtzi June 3, 2021 05:26
@ahoppen ahoppen requested a review from a team as a code owner June 3, 2021 05:26
@ahoppen
Copy link
Member Author

ahoppen commented Jun 3, 2021

@swift-ci Please test

@akyrtzi akyrtzi merged commit e263ff0 into swiftlang:release/5.5 Jun 4, 2021
@ahoppen ahoppen deleted the pr-5.5/fallback-typecheck-result-builder branch July 5, 2021 09:17
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants