www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17187] New: Error when using std.format.unformatValue with

https://issues.dlang.org/show_bug.cgi?id=17187

          Issue ID: 17187
           Summary: Error when using std.format.unformatValue with static
                    arrays
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: jack jackstouffer.com

auto str = "aaa";
auto spec = singleSpec("%s");
assert(str.unformatValue!(char[3])(spec) == ['a', 'a', 'a']);



std/conv.d(3877): Error: cannot implicitly convert expression (front(s)) of
type dchar to char
std/conv.d(3881): Error: cannot implicitly convert expression (parseEscape(s))
of type dchar to char
std/format.d(4961): Error: template instance std.conv.parseElement!(char,
string) error instantiating
std/format.d(4889):        instantiated from here: unformatElement!(char,
string, char)
std/format.d(4646):        instantiated from here: unformatRange!(char[3],
string, char)
std/format.d(4798):        instantiated from here: unformatValue!(char[3],
string, char)
std/range/primitives.d(347): Error: static assert  "Cannot put a dchar into a
char[]."
std/format.d(4668):        instantiated from here: put!(char[], dchar)
std/format.d(4798):        instantiated from here: unformatValue!(char[3],
string, char)

--
Feb 15