Never use a protocol's requirement signature as a generic signature #10711
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The protocol's requirement signature is not suitable for use as a complete generic signature, because it (intentionally) omits the root
Self: MyProtocol
requirement that makes the set of requirements sensible. Stop using generic signatures for requirement signatures---it's just a flat set of requirements.The only nontrivial change here is to conformance access paths. When we didn't have a requirement signature to use when constructing a requirement source (i.e., due to recursive protocols), we need to recanonicalize the path based on the now-computed requirement signature. This was canonicalizing using the generic signature formed from the requirement signature; use the protocol's generic signature instead, with a slight adjustment at the root of the requirement source.
All of this to eliminate the penultimate use of
ArchetypeResolutionKind::AlwaysPartial
.