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: 6115 Reporter: aguatto Assigned to:@gasche Status: closed (set by @xavierleroy on 2015-12-11T18:21:25Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.1 Category: typing Related to:#5380 Monitored by:@hcarty
Bug description
According to the Format documentation, when used in a format string
'@%' prints a '%' character. Thus, the following variable should be
of type 'unit' and print '%s' on the standard output. However, the
type checker thinks that %s is a format specifier:
let f = Format.printf "@%s";;
val f : string -> unit =
f "unused";;
%s- : unit = ()
This leads to segfault in more complex cases (see "Steps to reproduce").
Original bug ID: 6115
Reporter: aguatto
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:21:25Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.1
Category: typing
Related to: #5380
Monitored by: @hcarty
Bug description
According to the Format documentation, when used in a format string
'@%' prints a '%' character. Thus, the following variable should be
of type 'unit' and print '%s' on the standard output. However, the
type checker thinks that %s is a format specifier:
let f = Format.printf "@%s";;
val f : string -> unit =
f "unused";;
%s- : unit = ()
This leads to segfault in more complex cases (see "Steps to reproduce").
Steps to reproduce
Run the ocaml toplevel
Enter the following code:
Format.printf "@%s%a" "unused" (fun fmt x -> Format.fprintf fmt "%d" x) 42;;
The text was updated successfully, but these errors were encountered: