DIP1000 observation

Nick Treleaven nick at geany.org
Wed Aug 28 15:28:47 UTC 2024


On Tuesday, 27 August 2024 at 18:35:06 UTC, H. S. Teoh wrote:
> This analysis could have been done in compiler, transparently 
> to the user.

No - it would slow down the compiler if inference was done 
everywhere. It could also cause link errors because attributes 
are part of the mangled symbol name.

> The user should not have to care about this.  The fact that it 
> resulted in attribute soup that almost nobody fully 
> understands, indicates that something is wrong with its design.

It could just be `scope` on function parameters (for functions 
that aren't inferred). But then it would be useful to allow scope 
parameters to escape in documented ways, so that those functions 
can be @safe too. Hence the `return` attributes.


More information about the Digitalmars-d mailing list