[Issue 3235] [tdpl] Function literals must be deduced as function or delegate
http://d.puremagic.com/issues/show_bug.cgi?id=3235 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|REOPENED|RESOLVED CC||bugzi...@digitalmars.com Resolution||FIXED --- Comment #8 from Walter Bright bugzi...@digitalmars.com 2011-12-31 12:22:38 PST --- https://github.com/D-Programming-Language/dmd/commit/c50eb5f5726a65efa1224ff0f0fd60acbb6e3027 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3235] [tdpl] Function literals must be deduced as function or delegate
http://d.puremagic.com/issues/show_bug.cgi?id=3235 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||patch --- Comment #7 from Kenji Hara k.hara...@gmail.com 2011-12-30 21:23:43 PST --- https://github.com/D-Programming-Language/dmd/pull/588 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3235] [tdpl] Function literals must be deduced as function or delegate
http://d.puremagic.com/issues/show_bug.cgi?id=3235 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added Summary|TDPL: Function literals |[tdpl] Function literals |must be deduced as |must be deduced as |function or delegate|function or delegate --- Comment #6 from Andrei Alexandrescu and...@metalanguage.com 2011-12-18 20:05:41 PST --- The following example is in TDPL: unittest { auto f = (int i) {}; assert(is(f == function)); } The example fails to compile (it should). Also the following example should work: unittest { int a; auto f = (int i) { a = i; }; assert(is(f == delegate)); } The compiler should automatically infer function or delegate type depending on the literal's use of local state. The argument against it - people change a detail in the body of the function and its type changes - is non sequitur. Changing a literal from 10 to 10.0 also changes its type. Please fix. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---