Bug 22868 – __traits(parameters) returns parameters of delegate instead of function

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-10T23:50:48Z
Last change time
2022-03-27T02:24:34Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2022-03-10T23:50:48Z
__traits(parameters) currently yields the parameters of the delegate when the foreach iterates over an aggregate using opApply. This is wrong and leaks an implementation detail into user code. See the discussion thread here: https://forum.dlang.org/thread/[email protected]
Comment #1 by dlang-bot — 2022-03-10T23:56:15Z
@MoonlightSentinel created dlang/dmd pull request #13798 "Fix 22868 - Let __traits(parameters) see past opApply delegates" fixing this issue: - Fix 22868 - Let __traits(parameters) see past opApply delegates Ensure that `__traits(parameters)` consistently returns the parameters of the enclosing functions and doesn't return the parameters of the `opApply` delegate - leaking an implementation detail. https://github.com/dlang/dmd/pull/13798
Comment #2 by dlang-bot — 2022-03-11T14:29:25Z
@MoonlightSentinel created dlang/dmd pull request #13804 "alias parameters" fixing this issue: - Fix 22868 - Let __traits(parameters) see past opApply delegates Ensure that `__traits(parameters)` consistently returns the parameters of the enclosing function and instead of the parameters of the `opApply` delegate (leaking an implementation detail). Also added a bunch of tests - the parts hidden by `version (Fixed)` fail due to another bug. https://github.com/dlang/dmd/pull/13804
Comment #3 by dlang-bot — 2022-03-12T16:43:33Z
dlang/dmd pull request #13798 "Fix 22868 - Let __traits(parameters) see past opApply delegates" was merged into stable: - b070b2dbee6c474a80f1fe1f0eaeb6f717d3f051 by MoonlightSentinel: Fix 22868 - Let __traits(parameters) see past opApply delegates Ensure that `__traits(parameters)` consistently returns the parameters of the enclosing function and instead of the parameters of the `opApply` delegate (leaking an implementation detail). Also added a bunch of tests - the parts hidden by `version (Fixed)` fail due to another bug. https://github.com/dlang/dmd/pull/13798
Comment #4 by dlang-bot — 2022-03-27T02:24:34Z
dlang/dmd pull request #13892 "Merge stable into master" was merged into master: - aa42a6bfdb80b5c56b911d329d7bedbfa3eeb318 by MoonlightSentinel: Fix 22868 - Let __traits(parameters) see past opApply delegates Ensure that `__traits(parameters)` consistently returns the parameters of the enclosing function and instead of the parameters of the `opApply` delegate (leaking an implementation detail). Also added a bunch of tests - the parts hidden by `version (Fixed)` fail due to another bug. https://github.com/dlang/dmd/pull/13892