[Issue 20165] New: Add standard @nodiscard attribute for functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 24 23:24:28 UTC 2019


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

          Issue ID: 20165
           Summary: Add standard @nodiscard attribute for functions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: turkeyman at gmail.com

Can we please have a standard @nodiscard attribute that all implementations
agree on?
Do want compile errors when functions discard the result form @nodiscard
functions.
It can help reduce bugs in some cases, and it's a very nice self-documenting
feature which makes the API intent a little clearer.

--


More information about the Digitalmars-d-bugs mailing list