DIP60: @nogc attribute
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Fri Apr 18 12:20:06 PDT 2014
On 2014-04-16 19:52, Adam D. Ruppe wrote:
> 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.
Sounds like a job for AST macros.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list