On 04/14/2018 08:56 PM, bauss wrote:
I wish there was a way to give a mixin some kind of identity like:

mixin("mymixin", "somecode");

Where an error message would print something like:

Error in mixin("mymixin"): ...

That would completely solve this issue and I wouldn't have to have pragma(msg) all over the place.

The `#line` thing might help:

----
void main()
{
    mixin("#line 1 \"mymixin\"\n" ~ "somecode;");
        /* mymixin(1): Error: undefined identifier somecode */
    somecode;
        /* test.d(5): Error: undefined identifier somecode */
}
----

https://dlang.org/spec/lex.html#special-token-sequence

Reply via email to