On Wednesday, 16 April 2014 at 17:39:32 UTC, Walter Bright wrote:
Not practical. malloc() is only one way of allocating memory - user defined custom allocators are commonplace.

What I want is a __trait that scans for all call expressions in a particular function and returns all those functions.

Then, we can check them for UDAs using the regular way and start to implement library defined things like @safe, @nogc, etc. (safe and gc are a bit different because they also are affected by built-in language features, not just functions, but the same idea of recursively scanning for an annotation in the function body).

Of course, this wouldn't always be perfect, separate compilation could be used to lie about or hide annotations in a function prototype, but meh I don't really care about that, the main use for me would eb static asserts right under the function definition anyway.

Reply via email to