Skip to content

Commit af56a01

Browse files
committed
Sema: Add a couple of comments
1 parent 6e77f62 commit af56a01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4256,6 +4256,10 @@ bool TypeChecker::conformsToProtocol(Type T, ProtocolDecl *Proto,
42564256
}
42574257

42584258
/// Mark any _ObjectiveCBridgeable conformances in the given type as "used".
4259+
///
4260+
/// These conformances might not appear in any substitution lists produced
4261+
/// by Sema, since bridging is done at the SILGen level, so we have to
4262+
/// force them here to ensure SILGen can find them.
42594263
void TypeChecker::useObjectiveCBridgeableConformances(DeclContext *dc,
42604264
Type type) {
42614265
class Walker : public TypeWalker {
@@ -4277,6 +4281,8 @@ void TypeChecker::useObjectiveCBridgeableConformances(DeclContext *dc,
42774281
if (auto *nominalDecl = ty->getAnyNominal()) {
42784282
(void)TC.conformsToProtocol(ty, Proto, DC, options);
42794283

4284+
// Set and Dictionary bridging also requires the conformance
4285+
// of the key type to Hashable.
42804286
if (nominalDecl == TC.Context.getSetDecl() ||
42814287
nominalDecl == TC.Context.getDictionaryDecl()) {
42824288
auto args = ty->castTo<BoundGenericType>()->getGenericArgs();

0 commit comments

Comments
 (0)