D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16346 - Enum used as a constructor evaluates to the underlying type, not to the enum type.
Summary: Enum used as a constructor evaluates to the underlying type, not to the enum ...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL: http://dlang.org/
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-01 14:00 UTC by Eyal
Modified: 2017-03-22 12:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Eyal 2016-08-01 14:00:32 UTC
Test case:

enum A { B }
static assert(is(typeof(A.B) == A)); // succeeds
static assert(is(typeof(A(A.B)) == A)); // fails
Comment 1 Citrus 2017-01-12 15:15:53 UTC
Covered by DMD's PR https://github.com/dlang/dmd/pull/6431
Comment 2 github-bugzilla 2017-01-13 08:18:01 UTC
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 github-bugzilla 2017-01-16 23:26:26 UTC
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 github-bugzilla 2017-03-22 12:21:00 UTC
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