This is a regression of 16995 caused by:
commit 849155631cba3017566d3160cf15cb40584abf10
Author: Johan Engelen <[email protected]>
Date: Thu May 17 00:25:56 2018 +0200
fix Issue 18868 - nondeterministic static ctor/dtor
Instead of using a counter to create unique static ctor and dtor function identifiers, use the deterministic line+column location that is also used for unittests.
The further disambiguate mixin instantiations on the exact same location, use a local counter.
The reason the existing test for 16995 didn't break is because it only uses one module with unittests, and there must be two different modules with unittests on the same line:column to trigger the regression.
Comment #1 by johanengelen — 2018-07-05T19:50:03Z
Do you have a testcase ?
Comment #2 by atila.neves — 2018-07-06T10:30:20Z
Just compile two files separately with a unittest on the same line and column and have a third import the two and use __traits(getUnitTests). My failing test case is adding another imported module to the existing test at test/runnable/issue16995.d.
Also see discussion here at the forum:
https://forum.dlang.org/post/[email protected]
Comment #3 by atila.neves — 2018-07-06T10:49:42Z
I've taken a look at the code (I was trying to fix this). As mentioned before, counters can never work. The solution will have to go through using the absolute path of the location since the module doesn't "exist" until semantic.
This of course is redundant with respect to symbols colliding, because they won't - they'll get mangled according to their modules.
I'd rather only see adding the absolute file path if there are any collisions _and_ the identifiers are in the same module/filepath.
Comment #4 by code — 2018-08-22T11:05:34Z
Related to issue 14894
Comment #5 by github-bugzilla — 2018-08-27T04:30:37Z