https://d.puremagic.com/issues/show_bug.cgi?id=12544
monarchdodra gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |monarchdodra gmail.com
--- Comment #1 from monarchdodra gmail.com 2014-04-08 06:54:41 PDT ---
The code goes through the "formatRange" branch of `std.format`.
In format range, the code checks if it is a range of chars:
- range of chars => print string (eg: aaaaaaa...)
- range of non-chars => print array (eg: [A, A, A, A, A...
The issue is one of determining "what is a char"?
Currently, the code uses:
is(CharTypeOf!(ElementType!T))
Which mean any type that implicitly casts to char is fair game (including
structs with "alias this").
*Arguably*, I think `isSomeChar` would be better, as it only accepts *actual*
chars.
But even then, it would still accept enums whose base type is char, as
technically, they *are* chars.
Unfortunately, there is always ambiguity when asking to print an enum of a char
or string.
I don't know either if this is bug or working as designed. (I don't think it's
a regression though... did you test other versions?)
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------