Thread overview
[Issue 18037] Lambda with specified template type parameter does not work with IFTI
[Issue 18037] template lambda cannot deduce function from argument types
Dec 06, 2017
Ali Ak
Dec 17, 2022
Iain Buclaw
Nov 11
basile-z
December 06, 2017
https://issues.dlang.org/show_bug.cgi?id=18037

Ali Ak <ali.akhtarzada@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal

--
December 06, 2017
https://issues.dlang.org/show_bug.cgi?id=18037

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@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@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;

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18037

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
November 11
https://issues.dlang.org/show_bug.cgi?id=18037

basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=15499

--