Re: How to do reflection on alias symbols

2023-11-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 17, 2023 2:11:30 AM MST Arafel via Digitalmars-d-learn wrote: > I mean, in order to know if something is an `enum`, I need to do: > > ```d > enum isEnum(alias a) = is(typeof(a)) && !is(typeof()); > ``` > > which feels like the wrong approach, and too much error-prone. I also >

Re: How to do reflection on alias symbols

2023-11-17 Thread Arafel via Digitalmars-d-learn
On 17/11/23 2:48, Jonathan M Davis wrote: On Thursday, November 16, 2023 6:04:43 PM MST Jonathan M Davis via Digitalmars-d-learn wrote: Actually, it looks like there's already an old bug report on the issue: https://issues.dlang.org/show_bug.cgi?id=12363 So, it has been reported, but it looks

Re: How to do reflection on alias symbols

2023-11-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, November 16, 2023 6:04:43 PM MST Jonathan M Davis via Digitalmars-d-learn wrote: > I would suggest that you open up a bug report for it - > https://issues.dlang.org - and certainly, there's a good argument that what > you're seeing here is a bug. I fully expect that what you're

Re: How to do reflection on alias symbols

2023-11-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, November 16, 2023 3:03:25 AM MST Arafel via Digitalmars-d-learn wrote: > Hi all, > > Please consider the following currently non-working code: > > ```d > struct bar { > public alias pubInt = int; > private alias privInt = int; > } > > static foreach(member ;

How to do reflection on alias symbols

2023-11-16 Thread Arafel via Digitalmars-d-learn
Hi all, Please consider the following currently non-working code: ```d struct bar { public alias pubInt = int; private alias privInt = int; } static foreach(member ; __traits(allMembers, bar)) { // Error: argument `int` has no visibility pragma(msg, __traits(getVisibility,