[Issue 8589] Incorrect conversion of function returning `typeof(null)` to function returning an array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 26 04:38:15 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8589
bearophile_hugs at eml.cc changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bearophile_hugs at eml.cc
--- Comment #1 from bearophile_hugs at eml.cc 2012-08-26 04:38:12 PDT ---
This compiles:
f(() => null);
This causes no assert to fire:
foo(() => (int[]).init);
While this doesn't even compile:
foo(() => []);
Error: function test.foo (int[] function() del) is not callable using argument
types (void[] function() pure nothrow @safe)
See also Issue 7007
Since lot of time in D dynamic arrays are not pointers, so generally accepting
"null" as empty array literal is a wrong design decision, especially since the
"[]" literal is available.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list