Skip to content

[4.2][AST] Fix a crash in UnqualifiedLookup #18306

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

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Jul 27, 2018

Explanation: Add null type check for Self type in UnqualifiedLookup. It seems this doesn't happen in normal compilation. But when code-completion happens in inactive conditional compilation block, since surrounding context hasn't been typechecked, Self type can be null.
Scope: Code-completion regarding completion inside conditional compilation blocks
Issue: rdar://problem/41234606
Risk: Low. This is just a null check to avoid crash for code-completion functionality
Testing: Added regression test case.
Reviewed By: Doug Gregor (#18279)

Add null type check for `Self` type in `UnqualifiedLookup`. It seems this
doesn't happen in normal compilation. But when code-completion happens in
inactive conditional compilation block, since surrounding context hasn't
been typechecked, `Self` type can be null.

rdar://problem/41234606
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 27, 2018

@swift-ci Please test

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 28, 2018

@swift-ci nominate

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 28, 2018

/cc @rintaro

@akyrtzi akyrtzi merged commit fe1f442 into swiftlang:swift-4.2-branch Jul 28, 2018
@akyrtzi akyrtzi deleted the ide-complete-rdar41234606-4.2 branch July 28, 2018 01:10
@rintaro
Copy link
Member

rintaro commented Jul 30, 2018

Thanks!

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