[Issue 13845] Error using alias of typeof(null) as unnamed lambda parameter
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Dec 14 09:27:27 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13845
Peter Alexander <peter.alexander.au at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |peter.alexander.au at gmail.co
| |m
Component|Phobos |DMD
Summary|std.variant.Algebraic |Error using alias of
|"__lambda2 is not a |typeof(null) as unnamed
|function or delegate" when |lambda parameter
|using alias vs. bare type |
OS|Windows |All
--- Comment #1 from Peter Alexander <peter.alexander.au at gmail.com> ---
Reduced:
alias Null = typeof(null);
auto a = (int) => 0; // ok
auto b = (typeof(null)) => 0; // ok
auto c = (Null x) => 0; // ok
auto d = (Null) => 0; // error
Error: variable bug.d type void is inferred from initializer (Null) => 0, and
variables cannot be of type void
--
More information about the Digitalmars-d-bugs
mailing list