mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
Fix issue 21663 - std.concurrency.receiveOnly doesn't work with tuples
This commit is contained in:
parent
eb20ee3d56
commit
6e6e024fa3
1 changed files with 8 additions and 1 deletions
|
@ -796,6 +796,7 @@ in
|
|||
do
|
||||
{
|
||||
import std.format : format;
|
||||
import std.meta : allSatisfy;
|
||||
import std.typecons : Tuple;
|
||||
|
||||
Tuple!(T) ret;
|
||||
|
@ -803,7 +804,7 @@ do
|
|||
thisInfo.ident.mbox.get((T val) {
|
||||
static if (T.length)
|
||||
{
|
||||
static if (isAssignable!T)
|
||||
static if (allSatisfy!(isAssignable, T))
|
||||
{
|
||||
ret.field = val;
|
||||
}
|
||||
|
@ -888,6 +889,12 @@ do
|
|||
assert(result == "Unexpected message type: expected 'string', got 'int'");
|
||||
}
|
||||
|
||||
// https://issues.dlang.org/show_bug.cgi?id=21663
|
||||
@safe unittest
|
||||
{
|
||||
alias test = receiveOnly!(string, bool, bool);
|
||||
}
|
||||
|
||||
/**
|
||||
* Receives a message from another thread and gives up if no match
|
||||
* arrives within a specified duration.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue