https://issues.dlang.org/show_bug.cgi?id=15743

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from [email protected] ---
In `(string){}` and `(T){}`, `string` and `T` are actually parameter names, not
types. The function literals generate function templates like these:

    void foo(A)(A string) {}
    void foo(A)(A T) {}

And typeof of a template is void.

The same does not happen with `(int){}` because you can't have a parameter
named "int". So it's taken as a type instead.

I'm not sure if there's anything to be fixed/improved here. Maybe function
signatures like `void f(int string) {}` should not be allowed ("string" being
the name of the parameter here).

--

Reply via email to