You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5973 Reporter:@let-def Assigned to:@pierreweis Status: closed (set by @xavierleroy on 2015-12-11T18:18:44Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.1 Category: standard library Related to:#5380
Bug description
"@%s" format string when parsed by Format module breaks typing:
the @ escapes the following %s and the string argument won't be consumed at runtime, but the typer will still expect a string parameter.
Fixed in trunk and in 4.00.2+dev1. Old obsolete @ escape behaviour was still implemented in module Format. Weird.
Two remarks to conclude:
1 Your Format invocation has no semantics, since there is no pretty-printing box opened in your format string before any printing conversion specification.
2 As specified in the documentation, @ characters should be escaped in format strings for the Format module, otherwise the @ character must introduce a valid pretty printing indication. You should then write %@ instead of @ and open a box before printing. For instance, "@[%@%s%a@]" is a valid format string and should work as expected.
Original bug ID: 5973
Reporter: @let-def
Assigned to: @pierreweis
Status: closed (set by @xavierleroy on 2015-12-11T18:18:44Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.1
Category: standard library
Related to: #5380
Bug description
"@%s" format string when parsed by Format module breaks typing:
the @ escapes the following %s and the string argument won't be consumed at runtime, but the typer will still expect a string parameter.
Steps to reproduce
let _ = Format.(fprintf std_formatter "@%s%a" "" (fun _ _ -> ()) ())
Will execute "" as if it was a closure leading to unpredictable behavior, probably a segmentation fault.
The text was updated successfully, but these errors were encountered: