http://d.puremagic.com/issues/show_bug.cgi?id=3127
Summary: 'unreachable code' warning destroys delegate literal type inference Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Keywords: diagnostic Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: clugd...@yahoo.com.au D1 and D2. Compile with -w. =========== void bar(real delegate(real) f) { } void foo() { return; assert(0); } void main() { bar( (real x){ return x; }); } =========== Output with DMD1.045: C:\dev>dmd -w bug warning - bug.d(5): Error: statement is not reachable bug.d(9): Error: function bug.bar (real delegate(real)) does not match parameter types (int delegate(real x)) bug.d(9): Error: cannot implicitly convert expression (__dgliteral1) of type int delegate(real x) to real delegate(real) On DMD2.030, the type is 'void' instead: C:\dev>dmd -w bug warning - bug.d(5): Error: statement is not reachable bug.d(9): Error: function bug.bar (real delegate(real) f) does not match paramet er types (void delegate(real x)) bug.d(9): Error: cannot implicitly convert expression (__dgliteral1) of type voi d delegate(real x) to real delegate(real) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------