Escaped % char in interpolated string literals and TextWriterFormat accepts and ignores format flags, width and precision specifiers #14681
Labels
Area-Compiler
Compiler-related issues which don't belong to other categories
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Repro steps
Create a string literal containing a:
%
char, followed by a sequence that could be interpreted as format specifier's flag/width/precision, followed by another%
char.Expected behavior
Some sort of FS3376 error probably:
Actual behavior
Whatever is between the two
%
chars is ignored (as long as it looks like a valid format specifier, i.e. a flag/width/precision info), and the whole sequence is treated as an escaped%
:it also happens with regular (non-interpolated) string literals with printf:
Known workarounds
Workaround is probably not needed, as this should be an error.
The text was updated successfully, but these errors were encountered: