From c9e98070dffcd01e312d3b9bb6b26a6573f6f1da Mon Sep 17 00:00:00 2001 From: yulin Date: Tue, 25 Aug 2026 23:04:07 +0800 Subject: [PATCH] Fix __let.hpp __let_t get_completion_signatures() computation. __get_transform_fn actually requires __child_t a sender_in<_Env...>. --- include/stdexec/__detail/__let.hpp | 34 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/include/stdexec/__detail/__let.hpp b/include/stdexec/__detail/__let.hpp index 6fda73d36..32c05827a 100644 --- a/include/stdexec/__detail/__let.hpp +++ b/include/stdexec/__detail/__let.hpp @@ -624,23 +624,31 @@ namespace STDEXEC static_assert(__sender_for<_CvSender, _LetTag>); using __child_t = __child_of<_CvSender>; auto __completions = STDEXEC::get_completion_signatures<__child_t, _Env...>(); - auto __transform = __get_transform_fn<__fn_t<_CvSender>, __child_t, _Env...>(); - if constexpr (!__decay_copyable<_CvSender>) - { - return STDEXEC::__throw_compile_time_error<_SENDER_TYPE_IS_NOT_DECAY_COPYABLE_, - _WITH_PRETTY_SENDER_<_CvSender>>(); - } - else if constexpr (__t<_LetTag>() == STDEXEC::set_value) - { - return STDEXEC::__transform_completion_signatures(__completions, __transform); - } - else if constexpr (__t<_LetTag>() == STDEXEC::set_error) + + if constexpr (STDEXEC::sender_in<__child_t, _Env...>) { - return STDEXEC::__transform_completion_signatures(__completions, {}, __transform); + auto __transform = __get_transform_fn<__fn_t<_CvSender>, __child_t, _Env...>(); + if constexpr (!__decay_copyable<_CvSender>) + { + return STDEXEC::__throw_compile_time_error<_SENDER_TYPE_IS_NOT_DECAY_COPYABLE_, + _WITH_PRETTY_SENDER_<_CvSender>>(); + } + else if constexpr (__t<_LetTag>() == STDEXEC::set_value) + { + return STDEXEC::__transform_completion_signatures(__completions, __transform); + } + else if constexpr (__t<_LetTag>() == STDEXEC::set_error) + { + return STDEXEC::__transform_completion_signatures(__completions, {}, __transform); + } + else + { + return STDEXEC::__transform_completion_signatures(__completions, {}, {}, __transform); + } } else { - return STDEXEC::__transform_completion_signatures(__completions, {}, {}, __transform); + return __completions; } }