@@ -265,6 +265,10 @@ class GenericSignatureBuilder {
265
265
GenericSignatureBuilder (const GenericSignatureBuilder &) = delete;
266
266
GenericSignatureBuilder &operator =(const GenericSignatureBuilder &) = delete ;
267
267
268
+ // / Record that the given potential archetype is unresolved, so we know to
269
+ // / resolve it later.
270
+ void recordUnresolvedType (PotentialArchetype *unresolvedPA);
271
+
268
272
// / When a particular requirement cannot be resolved due to, e.g., a
269
273
// / currently-unresolvable or nested type, this routine should be
270
274
// / called to cope with the unresolved requirement.
@@ -294,6 +298,10 @@ class GenericSignatureBuilder {
294
298
ProtocolDecl *Proto,
295
299
const RequirementSource *Source);
296
300
301
+ // / Try to resolve the given unresolved potential archetype.
302
+ ConstraintResult resolveUnresolvedType (PotentialArchetype *pa,
303
+ bool allowTypoCorrection);
304
+
297
305
public:
298
306
// / \brief Add a new same-type requirement between two fully resolved types
299
307
// / (output of \c GenericSignatureBuilder::resolve).
@@ -1341,13 +1349,7 @@ class GenericSignatureBuilder::PotentialArchetype {
1341
1349
1342
1350
// / \brief Construct a new potential archetype for an unresolved
1343
1351
// / associated type.
1344
- PotentialArchetype (PotentialArchetype *parent, Identifier name)
1345
- : parentOrBuilder(parent), identifier(name), isUnresolvedNestedType(true ),
1346
- IsRecursive (false ), Invalid(false ),
1347
- DiagnosedRename(false )
1348
- {
1349
- assert (parent != nullptr && " Not an associated type?" );
1350
- }
1352
+ PotentialArchetype (PotentialArchetype *parent, Identifier name);
1351
1353
1352
1354
// / \brief Construct a new potential archetype for an associated type.
1353
1355
PotentialArchetype (PotentialArchetype *parent, AssociatedTypeDecl *assocType)
@@ -1694,7 +1696,22 @@ class GenericSignatureBuilder::PotentialArchetype {
1694
1696
// / Describes a requirement whose processing has been delayed for some reason.
1695
1697
class GenericSignatureBuilder ::DelayedRequirement {
1696
1698
public:
1697
- RequirementKind kind;
1699
+ enum Kind {
1700
+ // / A type requirement, which may be a conformance or a superclass
1701
+ // / requirement.
1702
+ Type,
1703
+
1704
+ // / A layout requirement.
1705
+ Layout,
1706
+
1707
+ // / A same-type requirement.
1708
+ SameType,
1709
+
1710
+ // / An unresolved potential archetype.
1711
+ Unresolved,
1712
+ };
1713
+
1714
+ Kind kind;
1698
1715
UnresolvedType lhs;
1699
1716
RequirementRHS rhs;
1700
1717
FloatingRequirementSource source;
0 commit comments