Skip to content

[CodeCompletion] Evaluate 'PatternBindingEntryRequest' before checking the init #28949

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
Jan 2, 2020

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Dec 26, 2019

If a completion happens in a PatternBindingInitializer context for TypedPattern without any VarDecl, e.g.:

let _: Int = <HERE>

it crashes because typeCheckPatternBinding() requires that the TypedPattern has the type.

rdar://problem/52105899

If a completion happens in an 'PatternBindingInitializer' context for
'TypedPattern' without any 'VarDecl', e.g.:

    let _: Int = <COMPLETION>

it crashes because 'typeCheckPatternBinding()' requires that the
'TypedPattern' has the type.

rdar://problem/52105899
@rintaro
Copy link
Member Author

rintaro commented Dec 26, 2019

@swift-ci Please smoke test

@rintaro rintaro changed the title [CodeCompletion] Evaluate 'PatternBindingEntry' before checking the init [CodeCompletion] Evaluate 'PatternBindingEntryRequest' before checking the init Dec 26, 2019
Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

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

Hopefully I can come back around here and requestify TypeChecker::typeCheckPatternBinding then provide a high-level "type check this whole pattern binding" request so this doesn't happen again.

@rintaro rintaro merged commit 9cd3072 into swiftlang:master Jan 2, 2020
@rintaro rintaro deleted the ide-completion-rdar52105899 branch January 13, 2020 19:23
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