[Issue 17187] New: Error when using std.format.unformatValue with static arrays

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 15 12:00:42 PST 2017


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 at puremagic.com
          Reporter: jack at 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)

--


More information about the Digitalmars-d-bugs mailing list