www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16074] New: std.concurrency receive wont work


          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 puremagic.com
          Reporter: fiorentini 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() {
                 (int message) {
                        writeln("Message ", message);

void main() {
        auto worker = spawn(&workerFunc);

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

May 25 2016