[NCGenerics] fold InverseType into PCT

We already need to track the inverses separate from the members in a
ProtocolCompositionType, since inverses aren't real types. Thus, the
only purpose being served by InverseType is to be eliminated by
RequirementLowering when it appears in a conformance requirement.

Instead, we introduce separate type InverseRequirement just to keep
track of which inverses we encounter to facilitate cancelling-out
defaults and ensuring that the inverses are respected after running
the RequirementMachine.
This commit is contained in:
Kavon Farvardin
2023-12-01 21:33:54 -08:00
parent 684739e3ec
commit 63b3e7624d
39 changed files with 544 additions and 423 deletions

View File

@@ -3,8 +3,8 @@
// REQUIRES: asserts
protocol RegularProto {}
protocol NCProto: ~Copyable, RegularProto {
// expected-warning@-1 {{protocol 'NCProto' should be declared to refine 'Copyable' due to a same-type constraint on 'Self'}}
protocol NCProto: RegularProto
where Self: ~Copyable { // expected-error{{'Self' required to be 'Copyable' but is marked with '~Copyable'}}
func checkIfCopyableSelf(_ s: Self)
}