Skip to content
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

[CodeComplete] Fix code completion of initialization for variable wrapped by generic property wrapper #36517

Merged
merged 1 commit into from Mar 26, 2021

Commits on Mar 19, 2021

  1. [CodeComplete] Fix code completion of initialization for variable wra…

    …pped by generic property wrapper
    
    If completing the initialization of a variable that’s wrapped in a generic, unbound property wrapper, the expression's type is an `UnboundGenericType`. AFAICT that’s expected and the correct type to assign.
    
    We hit the first assertion failure by trying to retrieve that type's substitution map. `UnboundGenericType`s were not handled here, so we crashed. AFAICT we can't get any substitutions out of an unbound generic type, so we should just continue looking into the parent type.
    
    We hit the second assertion when trying to retrieve the property wrapper’s backing type, which is null (becuase it couldn't be resolved). However, we haven’t emitted a diagnostic because the variable declaration is perfectly valid. Hence I’m removing the assertion.
    
    Fixes rdar://64141399
    ahoppen committed Mar 19, 2021
    Copy the full SHA
    28ee60e View commit details
    Browse the repository at this point in the history