http://d.puremagic.com/issues/show_bug.cgi?id=3797
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Version|2.040 |D2 --- Comment #11 from [email protected] 2011-05-14 08:12:54 PDT --- (In reply to comment #8) > *** Issue 5827 has been marked as a duplicate of this issue. *** Well, not exactly. But I guess it can be fixed together. My bug report was about function pointers with _different return types_ converting to each other: Timon Gehr wrote: > The following invalid D code is accepted by DMD: > > import std.stdio; > > int a=0; > ref int g(){ > writeln("called g"); > return ++a; > } > > void main(){ > int function() f=&g; //this should issue an error! > writeln(cast(int)&a); > writeln(f()); > } > > Output: > -144939256 > called g > -144939256 > > (&g is implicitly cast to "int function() ref", after that, the identical > calling conventions for "ref int" (int*) and int result in an implicit > reinterpret-cast from "ref int" to int.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
