GSB: The combination of a superclass and conformance requirement might force a type to be concrete #36746
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.
Let's use the redundant requirement graph to diagnose these, just like we already do for redundant conformance and layout requirements.
Also, diagnose conflicts:
The first two were already being diagnosed, the third is new. Here is an example:
We now reject this on account of
T
not satisfyingAnyObject
.And last but not least, another bug fix. A protocol can constrain an associated type to Self:
And a class might conform to this protocol:
The generic signature
<Self where Self : P, Self : C>
is built during conformance checking. SinceSelf : C
, we must have thatSelf.A == D
; sinceD.B == C
, the requirementA.B == Self
in protocol P implies thatSelf == C
. So the correct minimized signature here is<Self where Self == C>
.This wasn't handled properly before, because of assumptions in removeSelfDerived() and a couple of other places.
Fixes rdar://71677712, rdar://76155506, https://bugs.swift.org/browse/SR-10033, https://bugs.swift.org/browse/SR-13884.