Commits

camlspotter committed b93990c

failwith and invalid_arg are now format alike

  • Participants
  • Parent commits 4fb0051

Comments (0)

Files changed (2)

 let failwithf fmt = Printf.kprintf failwith fmt
+let failwith = failwithf
 let invalid_argf fmt = Printf.kprintf invalid_arg fmt
+let invalid_arg = invalid_argf
 
 exception Finally of exn * exn
 ;;
 (** {6 Printf style errors } *)
 
 val failwithf    : ('a, unit, string, 'b) format4 -> 'a
+val failwith     : ('a, unit, string, 'b) format4 -> 'a
+(** [failwith] is overridden by [failwithf], since
+
+    Mistyping [failwith "hello %s" "world"] instead of [failwithf "hello %s" "world"]
+    ignores the second argument.
+
+    Use [Pervasives.failwith] if you need one with type : string -> 'a
+ *) 
+
 val invalid_argf : ('a, unit, string, 'b) format4 -> 'a
+val invalid_arg  : ('a, unit, string, 'b) format4 -> 'a
 
 (** {6 Exception handling } *)