[Issue 18194] New: hasStaticMember doesn't work with static enum
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 5 12:33:18 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18194
Issue ID: 18194
Summary: hasStaticMember doesn't work with static enum
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: default_357-line at yahoo.de
Steps to reproduce:
class X
{
static int a;
static enum b;
}
static assert(hasStaticMember!(X, "a"));
static assert(hasStaticMember!(X, "b"));
What should happen:
Both asserts should pass.
What happens:
The second assert fails.
The error occurs because enum hasStaticMember(T, string member) =
__traits(compiles, &sym);, and enums don't have an address.
--
More information about the Digitalmars-d-bugs
mailing list