File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -172,3 +172,24 @@ swift::swift_modifyAtReferenceWritableKeyPath(YieldOnceBuffer *buffer,
172172 &_release_owner_continuation, buffer),
173173 addrAndOwner.Addr };
174174}
175+
176+ namespace {
177+ template <typename >
178+ struct YieldOnceCoroutine ;
179+
180+ // / A template which generates the type of the ramp function of a yield-once
181+ // / coroutine.
182+ template <typename ResultType, typename ... ArgumentTypes>
183+ struct YieldOnceCoroutine <ResultType(ArgumentTypes...)> {
184+ using type =
185+ SWIFT_CC (swift) YieldOnceResult<ResultType>(YieldOnceBuffer *,
186+ ArgumentTypes...);
187+ };
188+
189+ static_assert (std::is_same_v<decltype (swift_readAtKeyPath),
190+ YieldOnceCoroutine<const OpaqueValue * (const OpaqueValue *, void *)>::type>);
191+ static_assert (std::is_same_v<decltype (swift_modifyAtWritableKeyPath),
192+ YieldOnceCoroutine<OpaqueValue * (OpaqueValue *, void *)>::type>);
193+ static_assert (std::is_same_v<decltype (swift_modifyAtReferenceWritableKeyPath),
194+ YieldOnceCoroutine<OpaqueValue * (const OpaqueValue *, void *)>::type>);
195+ }
You can’t perform that action at this time.
0 commit comments