[Issue 18097] [REG2.077] Unittest function is undefined identifier

2018-02-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18097

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

https://github.com/dlang/dmd/commit/cab17a8744f920d083ff6afdfe5a3a06961ace56
Fix issue 18097 - unittest symbol names can be used before semantic pass

https://github.com/dlang/dmd/commit/e2b75ef17e2640ea2123243b82491d11c07a9848
Merge pull request #7761 from atilaneves/fix_18097

Fix issue 18097 - unittest symbol names can be used before semantic
merged-on-behalf-of: Iain Buclaw 

--


[Issue 18097] [REG2.077] Unittest function is undefined identifier

2018-02-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18097

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

   What|Removed |Added

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

--


[Issue 18097] [REG2.077] Unittest function is undefined identifier

2017-12-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18097

--- Comment #2 from Atila Neves  ---
I have a potential fix but am waiting on another PR of mine since there will be
merge conflicts.

--


[Issue 18097] [REG2.077] Unittest function is undefined identifier

2017-12-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18097

Atila Neves  changed:

   What|Removed |Added

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

--- Comment #1 from Atila Neves  ---
It's probably due to using an "old" identifier. With the change you mentioned
that introduced the bug, I had to set an identifier for the unittest functions
before semantic analysis. I didn't understand why, but tests failed and all
hell broke loose. I think I do now.

Basically there's no scope when the `UnitTestDeclaration` is created, and then
when semantic analysis happens the scope is there and a number counting the
unittests is added to the name. The only reason for this is to account for the
pathological case where a user defines two unittests on the same line, which is
unlikely to happen but can.

And that's the reason the 1st unittest has to be present for the bug to take
effect - before semantic analysis the final digits after the last underscore
are all `0`. After, they change. A (horrible, awful) workaround for now is to
change


auto c = &__unittest_dummy_d_3_2; //dlang 2.077

to

auto c = &__unittest_dummy_d_3_0; //dlang 2.077

It's not the name of the symbol that gets put into the object file, but it's
the name dmd thinks it has at that point.

--


[Issue 18097] [REG2.077] Unittest function is undefined identifier

2017-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18097

johanenge...@weka.io changed:

   What|Removed |Added

   Keywords||industry

--