cat > bug.d << CODE enum Enum : string { member = "printThis", } void main() { import std.stdio : writeln; writeln(member); } CODE dmd -run bug ---- Output is 'member' instead of 'printThis'. See http://dpaste.dzfl.pl/e801e755 ----
At best this is an enhancement request. But you are asking to add to make a special case for string enums.
I think this is by design. The EnumBaseType just indicates that the enum values can be implicitly converted to the EnumBaseType. It's not the same as `enum string member = "printThis";` I'm not a fan of special casing the output of string enums.
Maybe I was too fast with this, I just expected a different result. With anonymous enums it works btw. enum name1 = "printThis"; enum { name2 = "foo", name3 = "bar", } void main() { import std.stdio : writeln; writeln(name1, name2, name3); } http://dpaste.dzfl.pl/39b780cc