Bug 16083 – AliasSeq loses type of enums that have the same value

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-27T13:45:00Z
Last change time
2017-08-07T13:15:23Z
Assigned to
nobody
Creator
yazan.dabain

Comments

Comment #0 by yazan.dabain — 2016-05-27T13:45:03Z
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
Comment #1 by yazan.dabain — 2016-05-27T14:02:05Z
Clarification: --------------- import std.meta : AliasSeq; enum A : string { a = "foo" } enum B : string { b = "foo" } static assert(is(typeof(AliasSeq!(A.a)[0]) == A)); // AliasSeq(1) static assert(is(typeof(AliasSeq!(B.b)[0]) == B)); // currently fails but removing the line with AliasSeq(1) makes this succeed.
Comment #2 by github-bugzilla — 2017-03-09T08:12:41Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/71c5839088a6f7f5520b4df7d4cbb5ef94ae58d3 Fix issue 16083 - AliasSeq loses type of enums that have the same value https://github.com/dlang/dmd/commit/154681da54f4da93dc3350b94b378d484eeac351 Merge pull request #6571 from yazd/issue16083 Fix issue 16083 - AliasSeq loses type of enums that have the same value
Comment #3 by github-bugzilla — 2017-08-07T13:15:23Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/71c5839088a6f7f5520b4df7d4cbb5ef94ae58d3 Fix issue 16083 - AliasSeq loses type of enums that have the same value https://github.com/dlang/dmd/commit/154681da54f4da93dc3350b94b378d484eeac351 Merge pull request #6571 from yazd/issue16083