[Issue 9555] Type deduction for new lambda syntax literals breaks with templates
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 21 09:26:45 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9555
--- Comment #5 from Maxim Fomin <maxim at 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: -------
More information about the Digitalmars-d-bugs
mailing list