Skip to content

[4.2][CodeComplete] Use PrintOptionalAsImplicitlyUnwrapped to print IUO #18270

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jul 26, 2018

Cherry-pick of #18217 reviewed by @rudkx

  • Explaination: Use PrintOptions.PrintOptionalAsImplicitlyUnwrapped to print Optional type annotations in code-completion. Previously, it used to manually print ! after object type of the optional with an assumption where the type is Optional. Because of various reasons, there are several circumstances that the type is not optional, thus caused SourceKit crashes. Use ASTPrinter with the option which can handle them.
  • Scope: Code-completion regarding implicitly unwrapped optional.
  • Issue: rdar://problem/41046225, rdar://problem/42443512
  • Risk: Low. This is just a migration to well-tested ASTPrinter functionality from hand-crafted logic.
  • Testing: Added regression test cases.
  • Reviewed By: Mark Lacey ([CodeComplete] Use PrintOptionalAsImplicitlyUnwrapped to print IUO #18217)

Other instances of fb9c65e. Consistently use
PrintOption.PrintOptionalAsImplicitlyUnwrapped to print IUO.

rdar://problem/41046225
rdar://problem/42443512
@rintaro
Copy link
Member Author

rintaro commented Jul 26, 2018

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Jul 27, 2018

@swift-ci Please nominate

@rintaro rintaro changed the title [CodeComplete] Use PrintOptionalAsImplicitlyUnwrapped to print IUO [4.2][CodeComplete] Use PrintOptionalAsImplicitlyUnwrapped to print IUO Jul 27, 2018
@rintaro rintaro merged commit 9d01b59 into swiftlang:swift-4.2-branch Jul 27, 2018
@rintaro rintaro deleted the 4.2-ide-complete-printiuo branch July 27, 2018 02:13
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.

1 participant