@@ -139,7 +139,7 @@ struct InferredTypeWitnessesSolution {
139
139
#ifndef NDEBUG
140
140
LLVM_ATTRIBUTE_USED
141
141
#endif
142
- void dump ();
142
+ void dump () const ;
143
143
};
144
144
145
145
class RequirementEnvironment ;
@@ -707,6 +707,12 @@ class AssociatedTypeInference {
707
707
const llvm::SetVector<AssociatedTypeDecl *> &allUnresolved,
708
708
ValueDecl *req);
709
709
710
+ // / Infer associated type witnesses for the given associated type.
711
+ InferredAssociatedTypesByWitnesses inferTypeWitnessesViaAssociatedType (
712
+ ConformanceChecker &checker,
713
+ const llvm::SetVector<AssociatedTypeDecl *> &allUnresolved,
714
+ AssociatedTypeDecl *assocType);
715
+
710
716
// / Infer associated type witnesses for all relevant value requirements.
711
717
// /
712
718
// / \param assocTypes The set of associated types we're interested in.
@@ -728,12 +734,30 @@ class AssociatedTypeInference {
728
734
// / known to the compiler.
729
735
Type computeDerivedTypeWitness (AssociatedTypeDecl *assocType);
730
736
737
+ // / Compute a type witness without using a specific potential witness,
738
+ // / e.g., using a fixed type (from a refined protocol), default type
739
+ // / on an associated type, or deriving the type.
740
+ // /
741
+ // / \param allowDerived Whether to allow "derived" type witnesses.
742
+ Type computeAbstractTypeWitness (AssociatedTypeDecl *assocType,
743
+ bool allowDerived);
744
+
731
745
// / Substitute the current type witnesses into the given interface type.
732
746
Type substCurrentTypeWitnesses (Type type);
733
747
748
+ // / Retrieve substitution options with a tentative type witness
749
+ // / operation that queries the current set of type witnesses.
750
+ SubstOptions getSubstOptionsWithCurrentTypeWitnesses ();
751
+
734
752
// / Check whether the current set of type witnesses meets the
735
753
// / requirements of the protocol.
736
- bool checkCurrentTypeWitnesses ();
754
+ bool checkCurrentTypeWitnesses (
755
+ const SmallVectorImpl<std::pair<ValueDecl *, ValueDecl *>>
756
+ &valueWitnesses);
757
+
758
+ // / Check the current type witnesses against the
759
+ // / requirements of the given constrained extension.
760
+ bool checkConstrainedExtension (ExtensionDecl *ext);
737
761
738
762
// / Top-level operation to find solutions for the given unresolved
739
763
// / associated types.
0 commit comments