Bug 20782 – std.conv.to can't convert string to const enum

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-04-28T10:19:19Z
Last change time
2020-04-28T13:38:17Z
Keywords
pull
Assigned to
No Owner
Creator
Atila Neves

Comments

Comment #0 by atila.neves — 2020-04-28T10:19:19Z
------------------------- import std.conv: to; enum Enum { oops } "foo".to!(const Enum); // doesn't compile -------------------------
Comment #1 by dlang-bot — 2020-04-28T10:21:32Z
@atilaneves created dlang/phobos pull request #7464 "Fix issue 20782 - allow std.conv.to to convert string to const enum" fixing this issue: - Fix issue 20782 - allow std.conv.to to convert string to const enum The commit allows the following code to compile: ------------------------ enum Enum { oops } "foo".to!(const Enum); ------------------------ https://github.com/dlang/phobos/pull/7464
Comment #2 by dlang-bot — 2020-04-28T13:38:17Z
dlang/phobos pull request #7464 "Fix issue 20782 - allow std.conv.to to convert string to const enum" was merged into master: - 46933cf73ed7a127c4657f418280938e3d1bbd80 by Atila Neves: Fix issue 20782 - allow std.conv.to to convert string to const enum The commit allows the following code to compile: ------------------------ enum Enum { oops } "foo".to!(const Enum); ------------------------ https://github.com/dlang/phobos/pull/7464