[Dlang-internal] Separate compilation identifier mess and the bug trail that ensued

Atila Neves atila.neves at gmail.com
Thu Jul 26 09:09:07 UTC 2018


On Wednesday, 25 July 2018 at 22:19:41 UTC, kinke wrote:
> On Wednesday, 4 July 2018 at 22:15:36 UTC, Atila Neves wrote:
>> Using `static foreach` or mixing in unittests with strings 
>> meant that the different unittests shared line and column 
>> numbers. Oops.
>
> To make those corner cases unique and independent from compiler 
> invokations, maybe a stack of module-line-column infos could be 
> used instead of a single one. During semantic, each mixin would 
> push its Loc, and each static foreach iteration would push an 
> artificial one incl. iteration index.

If I do it during semantic analysis it would be easy: keep a 
counter per module. But I can't, due to the bugs reported above.

Basically there are situations in which the symbol is used (like 
taking the address of a unittest) before semantic analysis, where 
the symbol name would change.

Atila


More information about the Dlang-internal mailing list