Bug 17096 – many traits accept an invalid parameter count without error
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-01-16T06:15:06Z
Last change time
2021-01-03T22:57:09Z
Assigned to
No Owner
Creator
Basile-z
Comments
Comment #0 by b2.temp — 2017-01-16T06:15:06Z
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
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