Why is the error message coming by the end of the compilation?

ag0aep6g anonymous at example.com
Sun Apr 15 15:55:15 UTC 2018


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".


More information about the Digitalmars-d-learn mailing list