Discussion Thread: DIP 1038-- at nodiscard--Community Review Round 1

Paul Backus snarwin at gmail.com
Fri Dec 11 23:17:28 UTC 2020


On Friday, 11 December 2020 at 03:54:53 UTC, NotSpooky wrote:
> What I usually do to avoid exceptions is using Nullable/Variant 
> as the return type, as using it still needs checking.
> So, syntax sugar to return those seems like a nicer alternative 
> with less changes to the compiler and less @s

The idea is that you will be able to mark your Nullable/Variant 
type as @nodiscard, and the compiler will warn you if you forget 
to check it.

Marking the type as @nodiscard also means you will not have to 
annotate the individual functions, so in practice the number of 
@s needed should be fairly small.


More information about the Digitalmars-d mailing list