Unexpectedly nice case of auto return type

Andrea Fontana nospam at example.com
Tue Dec 3 08:47:45 UTC 2019


On Tuesday, 3 December 2019 at 07:24:31 UTC, Basile B. wrote:
>
>     A testA()
>     {
>         return alwaysReturnNull(); // Tnull can be implictly 
> converted to A
>     }
>
> still nice tho.

Why not [1]?

[1] typeof(null) alwaysReturnNull() { ... }

Andrea


More information about the Digitalmars-d-learn mailing list