[Issue 7644] New: [tdpl] receive( (OwnerTerminated) {} ); fails to compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 4 04:51:51 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7644

           Summary: [tdpl] receive( (OwnerTerminated) {} ); fails to
                    compile
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2012-03-04 04:51:48 PST ---
The code snippet on this page no longer compiles in 2.059

http://www.informit.com/articles/article.aspx?p=1609144&seqNum=8

Minimal example:
--------------------------------
void foo() {
    import std.concurrency;
    receive( (OwnerTerminated) { } );
}
--------------------------------

std/concurrency.d(529): Error: cannot have parameter of type void
std/concurrency.d(529): Error: variable
std.concurrency.receive!(void).receive._param_0 voids have no value


The problem appears to be with lambdas with unnamed user-defined parameters:

--------------------------------
class Foo {}
auto a = (Foo) {}; // error
auto b = (Foo f) {}; // ok
--------------------------------

If this is intentional, it wasn't mentioned as a breaking change in the 2.059
changelog.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list