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



--- Comment #5 from Maxim Fomin <ma...@maxim-fomin.ru> 2013-02-21 09:26:44 PST 
---
(In reply to comment #4)
> Waa, it is a template? Unexpected. What about turning this into enhancement
> request to improve error message though? Something like "not enough context to
> deduce lambda type".

Enough context can be provided later. 

template get(alias a)
{
    alias a!int get;
}

template foo(fun...)
{
    alias get!fun foo;
}

void main()
{
    alias foo!(a=>a) a;
    assert(a(1) == 1);
    assert(a(1.0) is 1.0); //NG
}

Note, this is reduced from how map and unaryfun works. If you turn it into
context-independent error, this would mean code break for some usages which are
currently accepted.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to