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: 6708 Reporter: MarkJosephs Status: closed (set by @alainfrisch on 2014-12-12T14:26:45Z) Resolution: not a bug Priority: normal Severity: minor Category: typing
Bug description
I would have expected Printf.sprintf to always try to perform the "format hack" on strings, but found that I had to help it by inserting "format_of_string".
Steps to reproduce
let selective_print singular = Printf.sprintf (if singular then "%s is fun" else "%s are fun");;
Error: This expression has type string but an expression was expected of type
('a, unit, string) format =
('a, unit, string, string, string, string) format6
let selective_print singular = Printf.sprintf (if singular then format_of_string "%s is fun" else format_of_string "%s are fun");;
val selective_print : bool -> string -> string =
The text was updated successfully, but these errors were encountered:
Original bug ID: 6708
Reporter: MarkJosephs
Status: closed (set by @alainfrisch on 2014-12-12T14:26:45Z)
Resolution: not a bug
Priority: normal
Severity: minor
Category: typing
Bug description
I would have expected Printf.sprintf to always try to perform the "format hack" on strings, but found that I had to help it by inserting "format_of_string".
Steps to reproduce
let selective_print singular = Printf.sprintf (if singular then "%s is fun" else "%s are fun");;
Error: This expression has type string but an expression was expected of type
('a, unit, string) format =
('a, unit, string, string, string, string) format6
let selective_print singular = Printf.sprintf (if singular then format_of_string "%s is fun" else format_of_string "%s are fun");;
val selective_print : bool -> string -> string =
The text was updated successfully, but these errors were encountered: