D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17096 - many traits accept an invalid parameter count without error
Summary: many traits accept an invalid parameter count without error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-16 06:15 UTC by basile-z
Modified: 2021-01-03 22:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2017-01-16 06:15:06 UTC
By error, if you don't know well the spec, this scenario is quite possible:


class B{final void foo(){}

enum a =__traits(isFinalFunction, B, "foo"); // compiles but wrong result

instead of

__traits(isFinalFunction, B.foo); // ok
Comment 1 Citrus 2017-01-16 13:33:46 UTC
Covered by DMD's PR https://github.com/dlang/dmd/pull/6456
Comment 2 github-bugzilla 2017-11-17 22:16:46 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/30e01ba7969ede07e0428132dfbdda9d3ddbe80e
Fix issue 17096 - Check the number of arguments given to __trait

https://github.com/dlang/dmd/commit/ad70d70153978bd4da878d73b7eca6d713643c60
Merge pull request #7330 from JinShil/fix_17096

Fix issue 17096 - Check the number of arguments given to __trait
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
Comment 3 github-bugzilla 2017-12-18 22:57:12 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/30e01ba7969ede07e0428132dfbdda9d3ddbe80e
Fix issue 17096 - Check the number of arguments given to __trait

https://github.com/dlang/dmd/commit/ad70d70153978bd4da878d73b7eca6d713643c60
Merge pull request #7330 from JinShil/fix_17096
Comment 4 Dlang Bot 2021-01-03 22:57:09 UTC
dlang/dmd pull request #12093 "[dmd-cxx] Backport more recent traits to the C++ port" was merged into dmd-cxx:

- 1602539c49d80c768d4ba68b7b2300ee3573ac0d by JinShil:
  [dmd-cxx] Fix issue 17096 - Check the number of arguments given to __trait

https://github.com/dlang/dmd/pull/12093