new DIP38: Safe references and rvalue references without runtime checks.

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 6 21:45:56 PDT 2013


On 5/6/13 11:44 PM, Timothee Cour wrote:
>> It requires interprocedural analysis. This is possible for the same
>> functions (such as template functions) that can infer pure/nothrow/@safe,
>> but it cannot be done for ordinary functions.
>
> Can you please provide me a simple example for which the algorithm
> proposed in the DIP38 will fail, and that does not involve cycles (as
> described in the DIP) ?

No. That's not the problem. It may as well work.

When typechecking a function, ALL you have is:

1. the body of that function

2. the signatures of all other functions. NOT adorned with extra info, 
NO bodies, NO nothing.

You need to make-do with that. Everything else explodes into 
interprocedural analysis. It's as cut and dried as it gets.


Andrei


More information about the Digitalmars-d mailing list