https://d.puremagic.com/issues/show_bug.cgi?id=12135
Summary: [AA] Format tail after associative array value is treated as separator if explicit separator is empty Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: wrong-code Severity: regression Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: verylonglogin....@gmail.com --- Comment #0 from Denis Shelomovskij <verylonglogin....@gmail.com> 2014-02-12 13:57:54 MSK --- These asserts should pass: --- import std.string; void main() { assert(format("%(%s:<%s>%|,%)", [1:2]) == "1:<2>"); // ok assert(format("%(%s:<%s>%|%)" , [1:2]) == "1:<2>"); // fails, "1:<2" } --- The second assert fails because in `formatValue` for AA the only test whether to treat format tail after associative array value as a separator is empty `f.sep`. Instead wheather there is an explicit separator ("%|") should be stored and checked, e.g. as a flag or non-null `f.sep` pointer. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------