@@ -823,10 +823,7 @@ class ModuleDecl
823
823
DeclName name,
824
824
SmallVectorImpl<ValueDecl*> &results) const ;
825
825
826
- // / Look for the conformance of the given type to the given protocol.
827
- // /
828
- // / This routine determines whether the given \c type conforms to the given
829
- // / \c protocol.
826
+ // / Global conformance lookup, does not check conditional requirements.
830
827
// /
831
828
// / \param type The type for which we are computing conformance.
832
829
// /
@@ -836,23 +833,33 @@ class ModuleDecl
836
833
// / might include "missing" conformances, which are synthesized for some
837
834
// / protocols as an error recovery mechanism.
838
835
// /
839
- // / \returns The result of the conformance search, which will be
840
- // / None if the type does not conform to the protocol or contain a
841
- // / ProtocolConformanceRef if it does conform.
836
+ // / \returns An invalid conformance if the search failed, otherwise an
837
+ // / abstract, concrete or pack conformance, depending on the lookup type.
842
838
ProtocolConformanceRef lookupConformance (Type type, ProtocolDecl *protocol,
843
839
bool allowMissing = false );
844
840
841
+ // / Global conformance lookup, checks conditional requirements.
842
+ // /
843
+ // / \param type The type for which we are computing conformance. Must not
844
+ // / contain type parameters.
845
+ // /
846
+ // / \param protocol The protocol to which we are computing conformance.
847
+ // /
848
+ // / \param allowMissing When \c true, the resulting conformance reference
849
+ // / might include "missing" conformances, which are synthesized for some
850
+ // / protocols as an error recovery mechanism.
851
+ // /
852
+ // / \returns An invalid conformance if the search failed, otherwise an
853
+ // / abstract, concrete or pack conformance, depending on the lookup type.
854
+ ProtocolConformanceRef checkConformance (Type type, ProtocolDecl *protocol,
855
+ // Note: different default than above
856
+ bool allowMissing = true );
857
+
845
858
// / Look for the conformance of the given existential type to the given
846
859
// / protocol.
847
860
ProtocolConformanceRef lookupExistentialConformance (Type type,
848
861
ProtocolDecl *protocol);
849
862
850
- // / Exposes TypeChecker functionality for querying protocol conformance.
851
- // / Returns a valid ProtocolConformanceRef only if all conditional
852
- // / requirements are successfully resolved.
853
- ProtocolConformanceRef conformsToProtocol (Type sourceTy,
854
- ProtocolDecl *targetProtocol);
855
-
856
863
// / Collect the conformances of \c fromType to each of the protocols of an
857
864
// / existential type's layout.
858
865
// /
0 commit comments