mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
RequirementMachine: Introduce TypeAliasRequirementsRequest
This is a verbatim copy of the GenericSignatureBuilder's somewhat questionable (but necessary for source compatibility) logic where protocol typealiases with the same name as some other associated type imply a same-type requirement. The related diagnostics are there too, but only emitted when -requirement-machine-protocol-signatures=on; in 'verify' mode, the GSB will emit the same diagnostics.
This commit is contained in:
@@ -4225,6 +4225,7 @@ class ProtocolDecl final : public NominalTypeDecl {
|
||||
friend class SuperclassDeclRequest;
|
||||
friend class SuperclassTypeRequest;
|
||||
friend class StructuralRequirementsRequest;
|
||||
friend class TypeAliasRequirementsRequest;
|
||||
friend class ProtocolDependenciesRequest;
|
||||
friend class RequirementSignatureRequest;
|
||||
friend class RequirementSignatureRequestRQM;
|
||||
@@ -4421,6 +4422,11 @@ public:
|
||||
/// instead.
|
||||
ArrayRef<StructuralRequirement> getStructuralRequirements() const;
|
||||
|
||||
/// Retrieve same-type requirements implied by protocol typealiases with the
|
||||
/// same name as associated types, and diagnose cases that are better expressed
|
||||
/// via a 'where' clause.
|
||||
ArrayRef<Requirement> getTypeAliasRequirements() const;
|
||||
|
||||
/// Get the list of protocols appearing on the right hand side of conformance
|
||||
/// requirements. Computed from the structural requirements, above.
|
||||
ArrayRef<ProtocolDecl *> getProtocolDependencies() const;
|
||||
|
||||
Reference in New Issue
Block a user