[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 20:55:05 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8589
--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-10 20:55:04 PDT ---
(In reply to comment #4)
> 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.
No, it is not allowed in current grammar. So it is not a bug, but a limitation.
> Also this won't work because '[]' will be typed as 'void[]':
That would be a type inference bug.
--
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