swift
1eadffcc - [CodeCompletion] Don’t crash when completing in a parameter position that only constraints one of two primary associated protocol types

Commit
2 years ago
[CodeCompletion] Don’t crash when completing in a parameter position that only constraints one of two primary associated protocol types When completing, we call `getExistentialType` on the contextual type to get a nice and concise description of the contextual parameter’s type that doesn’t contain archetypes and which we can also serialize into a USR so we are able to calculate type relations for code completion results from the code completion cache. When completing in a position that has a contextual type which only constrains one of two primary associated protocol types, this fails because `getExistentialType` (which calls `getDependentUpperBounds`) tries to form a `ParameterizedProtocolType`, which fails since not all primary associated types have been constrained. AFAICT the fix here is to just fall back to the default behavior of returning the plain protocol type instead of `abort`ing. rdar://108835466
Author
Parents
Loading