GSB: Start purging the notion of "derived via concrete" requirements #36811
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 notion of a 'derived via concrete' requirement was meant to handle the following scenario:
The requirement
Y : P
is implied byX : P
, sinceX : C<Y>
introducesY == X.T
, we haveX : P
, andT : P
in protocolP
. SinceX : P
is in turn implied byX : C<Y>
, we would normally consider bothX : P
andY : P
redundant -- but as soon as we dropX : P
, we must keepY : P
, sinceX : C<Y>
by itself does not imply thatY : P
. This was captured by saying thatY : P
was "derived via (the) concrete" requirementX : C<Y>
.However, the recently-introduced mechanism for rebuilding signatures after dropping redundant conformance requirements subsumes this notion. In the above example, once we drop
X : P
, we build the signatureX : C<Y>, Y : P
. The only thing we have to change is that when rebuilding a signature, instead of dropping all redundant requirements (which would also dropY : P
) we only drop those that are directly implied by a superclass or concrete type requirement.X : P
is directly implied byX : C<Y>
, butY : P
is derived fromX : P
.Since rebuilding doesn't yet work for requirement signatures, we can't remove it outright, but we can narrow it down to only occur with a requirement signature. Once we can rebuild requirement signatures, we can remove this logic entirely.