Bug 2997 – allMembers does not return interface members

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-05-17T03:05:00Z
Last change time
2015-06-09T01:27:58Z
Keywords
patch
Assigned to
bugzilla
Creator
rsinfu

Attachments

IDFilenameSummaryContent-TypeSize
372issue_allmembers.patchThis patch should fix the problem.text/plain2819
373issue_allmembers.patchFixed a typo.text/plain2814
561b2997.patchpatch for r365text/plain2756

Comments

Comment #0 by rsinfu — 2009-05-17T03:05:08Z
Created attachment 372 This patch should fix the problem. -------------------- abstract class B { void foo(); } interface I { void bar(); } abstract class C : B, I {} pragma(msg, __traits(allMembers, C).stringof); -------------------- The above code prints: -------------------- ["foo","toString","toHash","opCmp","opEquals","Monitor","factory"] -------------------- There is no "bar" in the output.
Comment #1 by rsinfu — 2009-05-17T04:22:47Z
Created attachment 373 Fixed a typo. I'm sorry - there's a typo in the patch 372 :-(
Comment #2 by hoganmeier — 2010-02-04T18:33:54Z
Created attachment 561 patch for r365 Since I played around with this a little bit I thought I'd post the updated patch for current svn r365. I wonder if there is a real world use case for this one. But I think so. If you have an abstract base class that implements some interfaces but leaves some of the functions out for its base classes and you want to know which functions all base classes have in common you need this fix to also get the interface ones. interface I { void bar(); } interface I2 { void bar2(); } abstract class B:I,I2 { void foo(); void bar();} pragma(msg, __traits(allMembers, B));
Comment #3 by hoganmeier — 2010-02-06T06:25:16Z
Of course the last two occurences of "base class" must be "sub class" in my previous comment ;)
Comment #4 by k.hara.pg — 2012-01-01T03:56:31Z
Comment #5 by bugzilla — 2012-01-11T15:13:54Z