D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21875 - std.format: wrong number of format specifiers in nested format string of associative arrays should be detected
Summary: std.format: wrong number of format specifiers in nested format string of asso...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-04-29 05:49 UTC by Berni44
Modified: 2021-04-29 13:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Berni44 2021-04-29 05:49:02 UTC
auto aa = [ 1 : "x", 2 : "y", 3 : "z" ];

format("%(%)", spelled);
format("%(%s%)", spelled);
format("%(%s%s%s%)", spelled);

All three format strings should be refuted with exceptions.
Comment 1 Berni44 2021-04-29 05:49:37 UTC
Sorry, should be `aa` instead of `spelled` in all three lines.
Comment 2 Dlang Bot 2021-04-29 06:02:33 UTC
@berni44 created dlang/phobos pull request #8019 "Fix Issue 21875 - std.format: wrong number of format specifiers in" fixing this issue:

- Fix Issue 21875 - std.format: wrong number of format specifiers in
  nested format string of associative arrays should be detected

https://github.com/dlang/phobos/pull/8019
Comment 3 Dlang Bot 2021-04-29 13:26:10 UTC
dlang/phobos pull request #8019 "Fix Issue 21875 - std.format: wrong number of format specifiers in" was merged into master:

- 45a753dd19fb6ea05cf87a6173b6f494182e0377 by berni44:
  Fix Issue 21875 - std.format: wrong number of format specifiers in
  nested format string of associative arrays should be detected

https://github.com/dlang/phobos/pull/8019