www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2997] New: allMembers does not return interface members

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2997

           Summary: allMembers does not return interface members
           Product: D
           Version: 2.030
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: rsinfu gmail.com


Created an attachment (id=372)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2997


Shin Fujishiro <rsinfu gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #372 is|0                           |1
           obsolete|                            |




--- Comment #1 from Shin Fujishiro <rsinfu gmail.com>  2009-05-17 04:22:47 PDT
---
Created an attachment (id=373)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=373)
Fixed a typo.

I'm sorry - there's a typo in the patch 372 :-(

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2997


Hoenir <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #373 is|0                           |1
           obsolete|                            |


--- Comment #2 from Hoenir <mrmocool gmx.de> 2010-02-04 18:33:54 PST ---
Created an attachment (id=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));

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 04 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2997


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de


--- Comment #3 from Trass3r <mrmocool gmx.de> 2010-02-06 06:25:16 PST ---
Of course the last two occurences of "base class" must be "sub class" in my
previous comment ;)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2010