@@ -296,6 +296,11 @@ class RequirementSource : public llvm::FoldingSetNode {
296
296
// / path.
297
297
bool isDerivedRequirement () const ;
298
298
299
+ // / Whether the requirement is derived via some concrete conformance, e.g.,
300
+ // / a concrete type's conformance to a protocol or a superclass's conformance
301
+ // / to a protocol.
302
+ bool isDerivedViaConcreteConformance () const ;
303
+
299
304
// / Retrieve a source location that corresponds to the requirement.
300
305
SourceLoc getLoc () const ;
301
306
@@ -712,7 +717,8 @@ class GenericSignatureBuilder::PotentialArchetype {
712
717
// / constrained.
713
718
Type ConcreteType;
714
719
715
- // / The source of the concrete type requirement.
720
+ // / The source of the concrete type requirement, if one was written
721
+ // / on this potential archetype.
716
722
const RequirementSource *ConcreteTypeSource = nullptr ;
717
723
718
724
// / Whether this is an unresolved nested type.
@@ -936,15 +942,16 @@ class GenericSignatureBuilder::PotentialArchetype {
936
942
SameTypeConstraints.end ());
937
943
}
938
944
939
- // / Retrieve the source of the same-type constraint that maps this potential
940
- // / archetype to a concrete type.
941
- const RequirementSource *getConcreteTypeSource () const {
942
- if (Representative != this )
943
- return Representative->getConcreteTypeSource ();
944
-
945
+ // / Retrieve the concrete type source as written on this potential archetype.
946
+ const RequirementSource *getConcreteTypeSourceAsWritten () const {
945
947
return ConcreteTypeSource;
946
948
}
947
949
950
+ // / Find a source of the same-type constraint that maps this potential
951
+ // / archetype to a concrete type somewhere in the equivalence class of this
952
+ // / type.
953
+ const RequirementSource *findAnyConcreteTypeSourceAsWritten () const ;
954
+
948
955
// / \brief Retrieve (or create) a nested type with the given name.
949
956
PotentialArchetype *getNestedType (Identifier Name,
950
957
GenericSignatureBuilder &builder);
0 commit comments