On Saturday, 6 December 2014 at 04:31:48 UTC, Sebastiaan Koppe wrote:
What about also adding the inverse of scope? Then scope can be inferred. As in:

```
void foo(int* p);
void free(P)(consume P* p);


Yes, this is much better. When I suggested it, it was rejected because D is too concerned about breaking existing code. Which is a not-very-good argument since this breaking change is concervative (you only have to add "consume" or something similar when the compiler complains).

The obvious solution is to do as you suggest and in addition do all @safe analysis on a high level IR layer using dataflow through and through.

Instead D continues down the rather flimsy path of partially addressing these issues in the type system… which will lead to a more complicated and less complete solution where @safe basically continues to be a leaky cauldron…

Reply via email to