On Sunday, 15 April 2018 at 15:55:15 UTC, ag0aep6g wrote:
On 04/15/2018 05:33 PM, bauss wrote:
On Sunday, 15 April 2018 at 10:27:26 UTC, ag0aep6g wrote:
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"): ...
[...]
    mixin("#line 1 \"mymixin\"\n" ~ "somecode;");
        /* mymixin(1): Error: undefined identifier somecode */
[...]
I don't see how the #line will help because you don't know which mixin the line would be associated with as they can come in any order.

I don't follow. It's not about setting the line number. The point is setting the source file name to "mymixin".

You asked for a way associate a name with a string mixin, and have that name included in errors. As far as I see, `#line` lets you do that.

Note how the error message in my example shows "mymixin".

Oh, I'm sorry I didn't notice that, my bad.

I guess adding that would be the equivalent to what my proposal is.

I'll give it a try and come back

Reply via email to