[Issue 12532] __traits(compiles, ...) fails to see valid enum symbols

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12532

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P2  |P3

--


[Issue 12532] __traits(compiles, ...) fails to see valid enum symbols

2014-04-07 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12532



--- Comment #2 from det <2k...@gmx.net> 2014-04-07 07:20:53 PDT ---
(In reply to comment #1)
> Reduced:
> 
> //
> enum a = is(typeof(b));
> enum b = is(typeof(a));
> 
> pragma(msg, a); //true
> pragma(msg, b); //false
> //
> 
> I'm not sure this is actually resolvable...?

sorry, i should have reduced it to

enum a = __traits(compiles, b);
pragma(msg, a); // true
enum b = __traits(compiles, a);
pragma(msg, b); // false

guess i was too preoccupied with issue 12533. however, i think b should be
true, __traits(compiles, ...) should not need the value or type of a. in other
words, it should be able to see that a symbol is defined without caring what it
actually is. as a matter of fact, in

enum c;
pragma(msg, typeof(c)); // _error_
pragma(msg, is(typeof(c)) );// false
enum d = __traits(compiles, c);
pragma(msg, d); // true

this is kinda happening.

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


[Issue 12532] __traits(compiles, ...) fails to see valid enum symbols

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12532


monarchdo...@gmail.com changed:

   What|Removed |Added

 CC||monarchdo...@gmail.com


--- Comment #1 from monarchdo...@gmail.com 2014-04-06 23:09:32 PDT ---
Reduced:

//
enum a = is(typeof(b));
enum b = is(typeof(a));

pragma(msg, a); //true
pragma(msg, b); //false
//

I'm not sure this is actually resolvable...?

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