DIP: @mustuse as function return value annotation

mw mw at gmail.com
Mon Aug 12 08:29:14 UTC 2024


On Monday, 12 August 2024 at 08:11:58 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 12/08/2024 8:09 PM, mw wrote:
>> I have no idea how the current D's compilation model works.
>> 
>> To implement what is proposed above, I assume there is only 
>> one global ASTree (singleton) of all the source files (even in 
>> the context of separate compilation of each D source file), 
>> which holds all the calculated annotation from different 
>> compilation passes, and the @mustuse checker is invoked after 
>> all the annotations are fully calculated.
>
> That works for one process invocation.
>
> But D is multi-process invocation.
>
> A process is built by multiple compiler executions and do not 
> share this knowledge.
>
> This information simply wouldn't exist for later stages of 
> compilation.

Can we write the ASTree to temporary files, or a daemon process? 
so the calculated global annotation can be shared by later 
compilation process.







More information about the dip.ideas mailing list