[Issue 16083] New: AliasSeq loses type of enums that have the same value
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri May 27 06:45:03 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16083
Issue ID: 16083
Summary: AliasSeq loses type of enums that have the same value
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: yazan.dabain at gmail.com
import std.meta : AliasSeq;
enum A : string { a = "foo" }
enum B : string { b = "foo" }
alias AA = AliasSeq!(A.a);
alias BB = AliasSeq!(B.b);
static assert(is(typeof(AA[0]) == A));
static assert(is(typeof(BB[0]) == B)); // this fails
---------------------
The problem disappears by doing any of the following:
- Removing one of the static asserts makes the other one pass.
- Making the value of A.a not equal to B.b
--
More information about the Digitalmars-d-bugs
mailing list