https://d.puremagic.com/issues/show_bug.cgi?id=11950

           Summary: Weird bracket behavior in delegates
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Daniel Čejchan <[email protected]> 2014-01-19 06:39:09 PST 
---
import std.stdio;
import std.conv;

//version = right;

struct A {
    int val = 3;
};


void main() {
    void delegate( A ) Ptr;

    Ptr = ( a ) {
        version( right )
        writefln( a.val.to!string ); 
        else
        writefln( ( a.val ).to!string ); 
    };

    A i;

    Ptr( i );
}

Code with writefln( ( a.val ).to!string ); causes an error (Error: need 'this'
for 'val' of type 'int'), the second one doesn't.

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

Reply via email to