swift
390f5c3e - [CS] Avoid crashing if we have no contextual type for initialization

Commit
2 years ago
[CS] Avoid crashing if we have no contextual type for initialization For `CTP_Initialization`, there's no contextual type to record if the pattern is not a `TypedPattern`. As such, tweak `RequirementFailure::getDeclRef` to handle this case. We probably ought to reconsider how we handle contextual types here, using a ContextualType locator when there is no contextual type recorded seems a bit weird, though in most cases we want to treat initializations the same regardless of if a TypedPattern was used. For now I'm leaving that as future work. rdar://111009224
Author
Committer
Parents
Loading