← Back to index
|
Original Bugzilla link
Bug 21639 – Inconsistent output for enum value when calling "text" vs "to!string"
Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2021-02-15T21:44:23Z
Last change time
2024-12-01T16:38:25Z
Assigned to
No Owner
Creator
apham
Moved to GitHub: phobos#9817 →
Comments
Comment #0
by apz28 — 2021-02-15T21:44:23Z
import std.stdio; import std.conv : text, to; enum I : int { x10 = 10, } enum C : char { xChar = '%', } enum S : string { xString = "a string", } void main() { writeln(to!string(I.x10)); // x10 writeln(to!string(C.xChar)); // xChar writeln(to!string(S.xString)); // xString writeln(text(I.x10, " ", C.xChar, " ", S.xString)); // x10 % xString }
Comment #1
by robert.schadek — 2024-12-01T16:38:25Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/phobos/issues/9817
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB