Bug 16346 – Enum used as a constructor evaluates to the underlying type, not to the enum type.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-08-01T14:00:00Z
Last change time
2017-03-22T12:21:00Z
Assigned to
nobody
Creator
eyal

Comments

Comment #0 by eyal — 2016-08-01T14:00:32Z
Test case: enum A { B } static assert(is(typeof(A.B) == A)); // succeeds static assert(is(typeof(A(A.B)) == A)); // fails
Comment #1 by bitter.taste — 2017-01-12T15:15:53Z
Comment #2 by github-bugzilla — 2017-01-13T08:18:01Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/82f8a0aa9e5237eaa60ad2df77b83f8b14003115 Fix issue 16346 - Use the correct type when constructing an enum https://github.com/dlang/dmd/commit/560798618a16e17a6482c9f98f2ec74b1561973b Merge pull request #6431 from LemonBoy/b16346 Fix issue 16346 - Use the correct type when constructing an enum
Comment #3 by github-bugzilla — 2017-01-16T23:26:26Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/82f8a0aa9e5237eaa60ad2df77b83f8b14003115 Fix issue 16346 - Use the correct type when constructing an enum https://github.com/dlang/dmd/commit/560798618a16e17a6482c9f98f2ec74b1561973b Merge pull request #6431 from LemonBoy/b16346
Comment #4 by github-bugzilla — 2017-03-22T12:21:00Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/82f8a0aa9e5237eaa60ad2df77b83f8b14003115 Fix issue 16346 - Use the correct type when constructing an enum https://github.com/dlang/dmd/commit/560798618a16e17a6482c9f98f2ec74b1561973b Merge pull request #6431 from LemonBoy/b16346