[Issue 11950] New: Weird bracket behavior in delegates
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 19 06:39:11 PST 2014
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: nobody at puremagic.com
ReportedBy: czdanol at gmail.com
--- Comment #0 from Daniel Čejchan <czdanol at gmail.com> 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: -------
More information about the Digitalmars-d-bugs
mailing list