Skip to content

[5.1][IDE][Sema] Fix code completion unreachable/hang in TypeBase::getContextSubtitutions #26889

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

nathawes
Copy link
Contributor

Cherry-pick of #26799 for swift-5.1-branch.

There are paths from Code completion giving it an UnboundGenericType, which it doesn't expect.

This patch:

  1. Updates the code completion paths to not attempt substitution on
    UnboundGenericTypes
  2. Updates getContextSubstitutions to assert and break out of the loop when
    given an unhandled type to avoid hanging release builds if a similar bug
    occurs in future.

Resolves rdar://problem/53959978

…extSubtitutions

There are paths from Code completion giving it an UnboundGenericType, which it
doesn't expect.

This patch:
1) Updates the code completion paths to not attempt substitution on
   UnboundGenericTypes
2) Updates getContextSubstitutions to assert and break out of the loop when
   given an unhandled type to avoid hanging release builds if a similar bug
   occurs in future.

Resolves rdar://problem/53959978
@nathawes
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d1bedea

@nathawes
Copy link
Contributor Author

@swift-ci please test OS X Platform

@nathawes nathawes requested a review from akyrtzi August 28, 2019 19:09
@nathawes nathawes marked this pull request as ready for review August 28, 2019 19:09
@nathawes nathawes requested a review from a team as a code owner August 28, 2019 19:09
@nathawes nathawes merged commit 93d25c1 into swiftlang:swift-5.1-branch Aug 28, 2019
@nathawes nathawes deleted the r53959978-code-completion-hang-in-getContextSubstitutions-5.1 branch August 28, 2019 21:37
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.

3 participants