[Issue 18037] Lambda with specified template type parameter does not work with IFTI
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 6 15:43:47 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=18037
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
Hardware|x86 |All
Summary|template lambda cannot |Lambda with specified
|deduce function from |template type parameter
|argument types |does not work with IFTI
OS|Mac OS X |All
--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Tested back to 2.070.0, which is where short lambda syntax was introduced.
Still fails.
The immutable looks odd, but even with alias this doesn't work.
alias lambda(T) = (T n) => n * n;
should expand to:
template lambda(T)
{
alias lambda = (T n) => n * n;
}
Neither of these successfully use IFTI.
However, these all work:
alias lambda = (int n) => n * n;
alias lambda = n => n * n;
--
More information about the Digitalmars-d-bugs
mailing list