[Issue 16074] New: std.concurrency receive wont work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 25 08:59:37 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16074

          Issue ID: 16074
           Summary: std.concurrency receive wont work
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: fiorentini at gmail.com

Hi guys, i noticed a strange compiler error when trying to use the
std.concurrency receive.

import std.stdio;
import std.concurrency;
import core.thread;

void workerFunc() {
        receive(
                 (int message) {
                        writeln("Message ", message);
                 }
        );
}


void main() {
        auto worker = spawn(&workerFunc);
    worker.send(10);
        thread_joinAll();
}

Trying to compile i got error "Error: function expected before (), not module
receive of type void"

Note: if i use receiveTimeout instead of receive there is no issue. I'm using
dmd version 2.071.0

--


More information about the Digitalmars-d-bugs mailing list