type x = Bool of bool | Int of int;; let rec to_formatter ff o = let pf = Format.fprintf ff in let _ = match o with | Bool b -> pf "%s" (string_of_bool b) | Int i -> pf "%d" i in ();; (* Error: This expression has type (int -> 'a, 'b, 'c, 'd, 'd, 'a) format6 but an expression was expected of type (string -> unit, Format.formatter, unit) format = (string -> unit, Format.formatter, unit, unit, unit, unit) format6 *)