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.
Comment #1 by k.hara.pg — 2015-03-25T05:08:31Z
Fixed in 2.066.
*** This issue has been marked as a duplicate of issue 12688 ***