| 21 |
with |
with |
| 22 |
| Stdpp.Exc_located (loc, e) -> raise (Location (loc, e)) |
| Stdpp.Exc_located (loc, e) -> raise (Location (loc, e)) |
| 23 |
|
|
| 24 |
|
let print_norm ppf d = |
| 25 |
|
Types.Print.print_descr ppf (Types.normalize d) |
| 26 |
|
|
| 27 |
let rec print_exn ppf = function |
let rec print_exn ppf = function |
| 28 |
| Location ((i,j), exn) -> |
| Location ((i,j), exn) -> |
| 29 |
if source = "" then |
if source = "" then |
| 43 |
Format.fprintf ppf "Wrong record selection: the label %s@\n" |
Format.fprintf ppf "Wrong record selection: the label %s@\n" |
| 44 |
(Types.label_name l); |
(Types.label_name l); |
| 45 |
Format.fprintf ppf "applied to an expression of type %a@\n" |
Format.fprintf ppf "applied to an expression of type %a@\n" |
| 46 |
Types.Print.print_descr t |
print_norm t |
| 47 |
| Typer.MultipleLabel l -> |
| Typer.MultipleLabel l -> |
| 48 |
Format.fprintf ppf "Multiple occurences for the record label %s@\n" |
Format.fprintf ppf "Multiple occurences for the record label %s@\n" |
| 49 |
(Types.label_name l); |
(Types.label_name l); |
| 50 |
| Typer.ShouldHave (t,msg) -> |
| Typer.ShouldHave (t,msg) -> |
| 51 |
Format.fprintf ppf "This expression should have type %a@\n%s@\n" |
Format.fprintf ppf "This expression should have type %a@\n%s@\n" |
| 52 |
Types.Print.print_descr t |
print_norm t |
| 53 |
msg |
msg |
| 54 |
| Typer.Constraint (s,t,msg) -> |
| Typer.Constraint (s,t,msg) -> |
| 55 |
Format.fprintf ppf "This expression should have type %a@\n" |
Format.fprintf ppf "This expression should have type %a@\n" |
| 56 |
Types.Print.print_descr t; |
print_norm t; |
| 57 |
Format.fprintf ppf "but its infered type is: %a@\n" |
Format.fprintf ppf "but its infered type is: %a@\n" |
| 58 |
Types.Print.print_descr s; |
print_norm s; |
| 59 |
Format.fprintf ppf "which is not a subtype, as shown by the value %a@\n" |
Format.fprintf ppf "which is not a subtype, as shown by the value %a@\n" |
| 60 |
Types.Print.print_sample (Types.Sample.get (Types.diff s t)); |
Types.Print.print_sample (Types.Sample.get (Types.diff s t)); |
| 61 |
Format.fprintf ppf "%s@\n" msg |
Format.fprintf ppf "%s@\n" msg |
| 62 |
| Typer.NonExhaustive t -> |
| Typer.NonExhaustive t -> |
| 63 |
Format.fprintf ppf "This pattern matching is not exhaustive@\n"; |
Format.fprintf ppf "This pattern matching is not exhaustive@\n"; |
| 64 |
Format.fprintf ppf "Residual type: %a@\n" |
Format.fprintf ppf "Residual type: %a@\n" |
| 65 |
Types.Print.print_descr t; |
print_norm t; |
| 66 |
Format.fprintf ppf "Sample value: %a@\n" |
Format.fprintf ppf "Sample value: %a@\n" |
| 67 |
Types.Print.print_sample (Types.Sample.get t) |
Types.Print.print_sample (Types.Sample.get t) |
| 68 |
| exn -> |
| exn -> |