www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - allMembers returns no members for a package

reply "aldanor" <i.s.smirnov gmail.com> writes:
pkg/
     c/
         module1.d
             module pkg.c.module1;
             int x = 1;
         package.d
             module pkg.c;
             public import pkg.c.module1;
     test.d
         module pkg.test;
         unittest {
             import std.stdio;
             import pkg.c;
             writeln(pkg.c.x);
             writeln(__traits(allMembers, pkg.c));
         }

Results in "1" printed and then nothing.

Why does allMembers fail on a package, is that supposed to happen?
Dec 18 2014
next sibling parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 19/12/2014 3:12 p.m., aldanor wrote:
 pkg/
      c/
          module1.d
              module pkg.c.module1;
              int x = 1;
          package.d
              module pkg.c;
              public import pkg.c.module1;
      test.d
          module pkg.test;
          unittest {
              import std.stdio;
              import pkg.c;
              writeln(pkg.c.x);
              writeln(__traits(allMembers, pkg.c));
          }

 Results in "1" printed and then nothing.

 Why does allMembers fail on a package, is that supposed to happen?
No, I have PR open for more or less this.
Dec 18 2014
parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 19/12/2014 3:51 p.m., Rikki Cattermole wrote:
 On 19/12/2014 3:12 p.m., aldanor wrote:
 pkg/
      c/
          module1.d
              module pkg.c.module1;
              int x = 1;
          package.d
              module pkg.c;
              public import pkg.c.module1;
      test.d
          module pkg.test;
          unittest {
              import std.stdio;
              import pkg.c;
              writeln(pkg.c.x);
              writeln(__traits(allMembers, pkg.c));
          }

 Results in "1" printed and then nothing.

 Why does allMembers fail on a package, is that supposed to happen?
No, I have PR open for more or less this.
My bad, read it too quickly.
Dec 19 2014
prev sibling parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Fri, 19 Dec 2014 02:12:40 +0000
aldanor via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 pkg/
      c/
          module1.d
              module pkg.c.module1;
              int x =3D 1;
          package.d
              module pkg.c;
              public import pkg.c.module1;
      test.d
          module pkg.test;
          unittest {
              import std.stdio;
              import pkg.c;
              writeln(pkg.c.x);
              writeln(__traits(allMembers, pkg.c));
          }
=20
 Results in "1" printed and then nothing.
=20
 Why does allMembers fail on a package, is that supposed to happen?
this is a known issue (sorry, can't remember bug number, and search in bugzilla never worked for me for some mysterious reason). this will eventually be fixed, but don't expect it soon, it's not a high-priority issue.
Dec 19 2014
parent reply "aldanor" <i.s.smirnov gmail.com> writes:
On Friday, 19 December 2014 at 12:06:08 UTC, ketmar via 
Digitalmars-d wrote:
 On Fri, 19 Dec 2014 02:12:40 +0000
 aldanor via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 pkg/
      c/
          module1.d
              module pkg.c.module1;
              int x = 1;
          package.d
              module pkg.c;
              public import pkg.c.module1;
      test.d
          module pkg.test;
          unittest {
              import std.stdio;
              import pkg.c;
              writeln(pkg.c.x);
              writeln(__traits(allMembers, pkg.c));
          }
 
 Results in "1" printed and then nothing.
 
 Why does allMembers fail on a package, is that supposed to 
 happen?
this is a known issue (sorry, can't remember bug number, and search in bugzilla never worked for me for some mysterious reason). this will eventually be fixed, but don't expect it soon, it's not a high-priority issue.
I see, thanks. Is there an open tracker issue for this? What's even more weird is that in some cases it does work (but most likely doesn't) and I can't seem to figure out what's the defining factor.
Dec 19 2014
parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Fri, 19 Dec 2014 13:55:53 +0000
aldanor via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On Friday, 19 December 2014 at 12:06:08 UTC, ketmar via=20
 Digitalmars-d wrote:
 On Fri, 19 Dec 2014 02:12:40 +0000
 aldanor via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 pkg/
      c/
          module1.d
              module pkg.c.module1;
              int x =3D 1;
          package.d
              module pkg.c;
              public import pkg.c.module1;
      test.d
          module pkg.test;
          unittest {
              import std.stdio;
              import pkg.c;
              writeln(pkg.c.x);
              writeln(__traits(allMembers, pkg.c));
          }
=20
 Results in "1" printed and then nothing.
=20
 Why does allMembers fail on a package, is that supposed to=20
 happen?
this is a known issue (sorry, can't remember bug number, and=20 search in bugzilla never worked for me for some mysterious reason). this=20 will eventually be fixed, but don't expect it soon, it's not a=20 high-priority issue.
I see, thanks. Is there an open tracker issue for this? =20 What's even more weird is that in some cases it does work (but=20 most likely doesn't) and I can't seem to figure out what's the=20 defining factor.
i remember that there was a discussion about this in NG, and some issues filled, but sorry, my search-fu sux. maybe someone with better skills will provide the links.
Dec 19 2014
parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 12/19/2014 06:05 AM, ketmar via Digitalmars-d wrote:

 my search-fu sux. maybe someone with better
 skills will provide the links.
Searching for 'allMembers package' found the following bug. :) https://issues.dlang.org/show_bug.cgi?id=11595 Ali
Dec 19 2014
parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Fri, 19 Dec 2014 16:24:39 -0800
Ali =C3=87ehreli via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On 12/19/2014 06:05 AM, ketmar via Digitalmars-d wrote:
=20
 my search-fu sux. maybe someone with better
 skills will provide the links.
=20 Searching for 'allMembers package' found the following bug. :) =20 https://issues.dlang.org/show_bug.cgi?id=3D11595 =20
yeah. but as i wrote before, any bugzilla search returns empty results for me. literally. the only way i can search for something is to try to fill a new issue and then type search terms in subj field. and i constantly forgetting about "site:" feature of google.
Dec 19 2014