Bug 21330 – __traits(getUnitTests) should include unittests from anonymous mixins

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-10-19T17:15:44Z
Last change time
2020-11-16T00:10:11Z
Keywords
pull
Assigned to
No Owner
Creator
Max Samukha

Comments

Comment #0 by maxsamukha — 2020-10-19T17:15:44Z
mixin template Test() { unittest { } void foo() { } } mixin Test; pragma(msg, __traits(allMembers, onlineapp)); // tuple("object", "Test", "foo", "main") pragma(msg, __traits(getUnitTests, onlineapp)); // tuple() void main() { } If allMembers returns "foo", then it is reasonable to expect that getUnitTests should return the unittest. Actually, it it impossible to get to the unittest at all because it is impossible to refer to anonymous mixins explicitly.
Comment #1 by dlang-bot — 2020-10-19T22:52:20Z
@BorisCarvajal created dlang/dmd pull request #11888 "Fix Issue 21330 - __traits(getUnitTests) should include unittests fro…" fixing this issue: - Fix Issue 21330 - __traits(getUnitTests) should include unittests from anonymous mixins https://github.com/dlang/dmd/pull/11888
Comment #2 by dlang-bot — 2020-10-19T23:33:42Z
dlang/dmd pull request #11888 "Fix Issue 21330 - __traits(getUnitTests) should include unittests fro…" was merged into stable: - 0c7ee93587ad75793c7fa67ac896cb6b9180d6f2 by Boris Carvajal: Fix Issue 21330 - __traits(getUnitTests) should include unittests from anonymous mixins https://github.com/dlang/dmd/pull/11888
Comment #3 by dlang-bot — 2020-11-16T00:10:11Z
dlang/dmd pull request #11961 "merge stable" was merged into master: - 738ea653d94c17a534aa9350fdbdb377befa41d2 by Boris Carvajal: Fix Issue 21330 - __traits(getUnitTests) should include unittests from anonymous mixins https://github.com/dlang/dmd/pull/11961