Skip to content

Commit 332e20f

Browse files
committed
handle conformance requirement on extension in distributed funcs
1 parent 3d47f70 commit 332e20f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

include/swift/AST/ASTSynthesis.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@ enum SingletonTypeSynthesizer {
4141
_any,
4242
_bridgeObject,
4343
_error,
44-
_executor,
44+
_executor, // the 'BuiltinExecutor' type
4545
_job,
4646
_nativeObject,
4747
_never,
4848
_rawPointer,
4949
_rawUnsafeContinuation,
5050
_void,
5151
_word,
52-
_serialExecutor,
52+
_executorProtocol, // the '_Concurrency.Executor' protocol
53+
_serialExecutor, // the '_Concurrency.SerialExecutor' protocol
5354
};
5455
inline Type synthesizeType(SynthesisContext &SC,
5556
SingletonTypeSynthesizer kind) {
@@ -66,9 +67,15 @@ inline Type synthesizeType(SynthesisContext &SC,
6667
case _void: return SC.Context.TheEmptyTupleType;
6768
case _word: return BuiltinIntegerType::get(BuiltinIntegerWidth::pointer(),
6869
SC.Context);
69-
case _serialExecutor:
70+
case _executorProtocol:
71+
return SC.Context.getProtocol(KnownProtocolKind::Executor)
72+
->getDeclaredInterfaceType();
73+
case _serialExecutor:
7074
return SC.Context.getProtocol(KnownProtocolKind::SerialExecutor)
7175
->getDeclaredInterfaceType();
76+
case _taskExecutor:
77+
return SC.Context.getProtocol(KnownProtocolKind::TaskExecutor)
78+
->getDeclaredInterfaceType();
7279
}
7380
}
7481

include/swift/AST/DistributedDecl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ getDistributedSerializationRequirements(
115115
ProtocolDecl *protocol,
116116
llvm::SmallPtrSetImpl<ProtocolDecl *> &requirementProtos);
117117

118-
// ==== ------------------------------------------------------------------------
118+
}
119119

120120
#endif /* SWIFT_DECL_DISTRIBUTEDDECL_H */

0 commit comments

Comments
 (0)