[Issue 3235] Function literals must be deduced as "function" or "delegate"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 8 07:17:18 PDT 2009


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





--- Comment #1 from Andrei Alexandrescu <andrei at metalanguage.com>  2009-08-08 07:17:17 PDT ---
(In reply to comment #0)
> Consider:
> 
> void foo(alias pred)() {
>     pragma(msg, pred.stringof);
> }
> 
> unittest {
>     foo!((i) { return i < 0; })();
>     int z = 1;
>     foo!((i) { return i < z; })();
> }
> 
> void main(string[] args)
> {
> }
> 
> This outputs:
> 
> __funcliteral1(__T2)
> __dgliteral3(__T4)
> 
> because the first literal does not have to be a delegate.

I meant that right now this outputs:

__dgliteral1(__T2)
__dgliteral3(__T4)

and it should output:

__funcliteral1(__T2)
__dgliteral3(__T4)

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