[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-07-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

--- Comment #6 from Atila Neves  ---
I forgot to mention that the issue here is the same issue as before with the
unittest names - counters can't and won't work, because the number will vary
depending on how the compiler is invoked.

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-07-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

Atila Neves  changed:

   What|Removed |Added

 CC||atila.ne...@gmail.com

--- Comment #5 from Atila Neves  ---
The fix for this issue introduces a regression and breaks usage of
__traits(getUnitTests) and separate compilation. Issue here:

https://issues.dlang.org/show_bug.cgi?id=19058

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-06-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

FeepingCreature  changed:

   What|Removed |Added

 CC||default_357-l...@yahoo.de

--- Comment #4 from FeepingCreature  ---
This also fixes this issue:

static foreach (entry; ["foo", "bar", "baz"])
{
  unittest
  {
writeln(entry);
  }
}

foo
foo
foo

which happened because all three unittest blocks had the same identifier, based
on line number.

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-05-28 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/849155631cba3017566d3160cf15cb40584abf10
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.

https://github.com/dlang/dmd/commit/cf19b78d47572e1c6d1a79687ea592b051552e93
Merge pull request #8255 from JohanEngelen/fix18868

fix Issue 18868 - nondeterministic static ctor/dtor
merged-on-behalf-of: Jacob Carlborg 

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-05-28 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-05-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

--- Comment #2 from johanenge...@weka.io ---
Extra testcase that must be added and considered (currently works):
```
static foreach(s; ["666", "777"]) {
mixin(genCtor(s));
}

int i;

string genCtor(string a)
{
return "static this() { i += " ~ a ~ "; }";
}

void main()
{
assert(i == 0 + 666 + 777);
}
```

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-05-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

Shachar Shemesh  changed:

   What|Removed |Added

 CC||shac...@weka.io

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-05-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

--- Comment #1 from johanenge...@weka.io ---
https://github.com/dlang/dmd/pull/8255

--


[Issue 18868] Separate compilation generates two static this functions, runs it twice

2018-05-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18868

johanenge...@weka.io changed:

   What|Removed |Added

   Keywords||industry

--