[Issue 19068] New: __traits(identifier) returns the wrong string when importing a template from a module
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 6 16:41:08 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19068
Issue ID: 19068
Summary: __traits(identifier) returns the wrong string when
importing a template from a module
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: atila.neves at gmail.com
/// mod.d
auto identity(T)(T t) { return t; }
///
/// main.d
import mod;
alias identityInt = identity!int;
enum memberName = __traits(identifier, __traits(getMember, main,
"identityInt"));
static assert(memberName == "identityInt",
"Expected 'identityInt', got '" ~ memberName ~ "'");
///
The static assert fails, with __traits(identifier) returning "identity" instead
of "identityInt".
--
More information about the Digitalmars-d-bugs
mailing list