[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 Mar 10 16:36:16 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8589


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-10 16:36:13 PDT ---
Kenji, is this a parser bug?

f(() => int[].init);

test.d(11): Error: found '[' when expecting '.' following int
test.d(11): Error: found ']' when expecting identifier following 'int.'

You have to use:

f(() => (int[]).init);

But that's not very convenient.

Also this won't work because '[]' will be typed as 'void[]':

f(() => []);

But I guess we'll have to live with that for now..

-- 
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