diff --git a/std/concurrency.d b/std/concurrency.d index 92fda87ee..e2089bcd6 100644 --- a/std/concurrency.d +++ b/std/concurrency.d @@ -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.