Skip to content

[4.2][CodeComplete] Fix several crashes in getOperatorCompletions #17573

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 3 commits into from
Jun 28, 2018

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jun 27, 2018

Cherry-Pick of #17556 reviewed by @benlangmuir

  • Handle assign expression after typechecking. Previously, AssignExpr was wrongly reused in re-typechecking. We need to unfold/flatten them before re-typechekcing.
  • In getOperatorCompletions(), for each every known operators, temporary expressions are created and typechecked. In this process, typechecker may set the type of the parsed expression. That may cause inaccurate completion results or crash at worst.
  • [CSRanking] Handle EnumElementDecl in IUO parameter checking.

rdar://problem/28188259
rdar://problem/41232519
rdar://problem/41159258

@rintaro
Copy link
Member Author

rintaro commented Jun 27, 2018

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e31b7ddec87e10ebbfd3c7a4b6434e064dcdc026

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e31b7ddec87e10ebbfd3c7a4b6434e064dcdc026

rintaro added 3 commits June 28, 2018 10:26
rdar://problem/41232519
rdar://problem/41159258
In getOperatorCompletions(), for each every known operators, temporary
expressions are created and typechecked. In this process, typechecker
may set the type of the parsed expression. That may cause non-accurate
completion results or crash at worst.

rdar://problem/28188259
@rintaro rintaro force-pushed the 4.2-ide-complete-sequence branch from e31b7dd to 3402127 Compare June 28, 2018 01:42
@rintaro
Copy link
Member Author

rintaro commented Jun 28, 2018

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e31b7ddec87e10ebbfd3c7a4b6434e064dcdc026

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e31b7ddec87e10ebbfd3c7a4b6434e064dcdc026

@rintaro rintaro merged commit 73535cc into swiftlang:swift-4.2-branch Jun 28, 2018
@rintaro rintaro deleted the 4.2-ide-complete-sequence branch June 28, 2018 06:05
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