Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/beman/execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ list(
issue-144.test
issue-174.test
issue-186.test
issue-252.test
issue-313.test
meta-combine.test
meta-contains.test
Expand Down
44 changes: 44 additions & 0 deletions tests/beman/execution/issue-252.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// tests/beman/execution/issue-252.test.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <test/execution.hpp>
#ifdef BEMAN_HAS_MODULES
import beman.execution;
#else
#include <beman/execution.hpp>
#endif

namespace ex = beman::execution;

namespace {
struct non_decomposable_sender {
using sender_concept = ex::sender_tag;

template <typename...>
static consteval auto get_completion_signatures() -> ex::completion_signatures<ex::set_value_t()> {
return {};
}

non_decomposable_sender(int, int) {}
};

struct decomposable_sender {
using sender_concept = ex::sender_tag;
using is_basic_sender_tag = void;

struct tag {};
tag tag_value;
int data;
};
} // namespace

TEST(issue252) {
static_assert(ex::sender<non_decomposable_sender>);
static_assert(std::same_as<ex::completion_signatures<ex::set_value_t()>,
decltype(ex::get_completion_signatures<non_decomposable_sender, ex::env<>>())>);

static_assert(std::same_as<void, ex::tag_of_t<non_decomposable_sender>>);
static_assert(std::same_as<decomposable_sender::tag, ex::tag_of_t<decomposable_sender>>);

(void)ex::get_completion_signatures<non_decomposable_sender, ex::env<>>();
}
Loading