Issue 12997 - Variant's coerce function does not go from enums to their underlying types
Summary: Variant's coerce function does not go from enums to their underlying types
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-26 22:51 UTC by Mark Isaacson
Modified: 2024-12-01 16: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 Mark Isaacson 2014-06-26 22:51:16 UTC

    
Comment 1 Mark Isaacson 2014-06-26 22:53:07 UTC
enum TestEnum : int {
  Bob
}

auto v = Variant(TestEnum.Bob);

auto x = v.coerce!int(); //Throws exception
Comment 2 dlangBugzillaToGithub 2024-12-01 16:21:40 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10066

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB