DIP 1038: @nodiscard - Unofficial "post-final" review

Dukc ajieskola at gmail.com
Mon Feb 22 20:12:05 UTC 2021


On Monday, 22 February 2021 at 12:59:02 UTC, Mike Parker wrote:
> No. If the changes affected the details of the proposed 
> feature, then yes, I would reboot the process and go back to 
> another official community review round. That's not the case 
> here, so it's fine to do it informally so as not to drag the 
> process out any longer than we need to.

Ok. Did a quick read and started to ponder one thing. The DIP 
claims no breaking changes. If somebody is currently annotating 
something with `@nodiscard` and using it so that the function 
return value is discarded, it means that he must have a local 
definition of `@nodiscard` and that will override the 
`core.attribute` definition, and be no longer recognised by the 
compiler. Is that correct?

Even in that case, there is a theoretical possibility that the 
user-defined `@nodiscard` is annotated in different module than 
where it is used, and the user also happens to import 
`core.attribute`. That would result in an ambiguous symbol.

This is so far-fetched that it'll have no practical signifiance, 
but if we're strict about mentioning all breaking changes it goes 
there.


More information about the Digitalmars-d mailing list