Original bug ID: 7060 Reporter: mgiovann Assigned to:@dra27 Status: closed (set by @dra27 on 2017-02-10T16:45:41Z) Resolution: fixed Priority: low Severity: feature Version: 4.02.3 Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Category: ~DO NOT USE (was: OCaml general) Tags: junior_job Monitored by: runhang @gasche@diml
Bug description
When evaluating an expression for whose type a custom printer is installed, if the evaluation results in an exception, the toplevel catches the exception but prints the uninformative "printer xx raised an exception" (genprintval.ml 151-152). On the other hand, if the expression has no custom printer installed, the toplevel prints the exception itself.
Note in the below example that the toplevel already prints the type of the expression as if the value were available.
Steps to reproduce
With the following ADT:
module M : sig
type t
val inj : int -> t
val pp_print : Format.formatter -> t -> unit
end = struct
type t = int
let inj n = n
let prj n = if n < 0 then invalid_arg "M" else n
let pp_print pp n = Format.pp_print_int pp (prj n)
end ;;
Then in the toplevel:
M.pp_print Format.std_formatter (M.inj (-3));;
Exception: Invalid_argument "M".
#install_printer M.pp_print;;
M.inj (-3);;
: M.t =
The text was updated successfully, but these errors were encountered:
Original bug ID: 7060
Reporter: mgiovann
Assigned to: @dra27
Status: closed (set by @dra27 on 2017-02-10T16:45:41Z)
Resolution: fixed
Priority: low
Severity: feature
Version: 4.02.3
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: ~DO NOT USE (was: OCaml general)
Tags: junior_job
Monitored by: runhang @gasche @diml
Bug description
When evaluating an expression for whose type a custom printer is installed, if the evaluation results in an exception, the toplevel catches the exception but prints the uninformative "printer xx raised an exception" (genprintval.ml 151-152). On the other hand, if the expression has no custom printer installed, the toplevel prints the exception itself.
Note in the below example that the toplevel already prints the type of the expression as if the value were available.
Steps to reproduce
With the following ADT:
module M : sig
type t
val inj : int -> t
val pp_print : Format.formatter -> t -> unit
end = struct
type t = int
let inj n = n
let prj n = if n < 0 then invalid_arg "M" else n
let pp_print pp n = Format.pp_print_int pp (prj n)
end ;;
Then in the toplevel:
M.pp_print Format.std_formatter (M.inj (-3));;
Exception: Invalid_argument "M".
#install_printer M.pp_print;;
M.inj (-3);;
The text was updated successfully, but these errors were encountered: