@@ -37,8 +37,7 @@ let simple_conversions = [
37
37
let print_simple_conversion ppf (actual , expected ) =
38
38
try (
39
39
let converter = List. assoc (actual, expected) simple_conversions in
40
- Format. pp_print_newline ppf () ;
41
- fprintf ppf " @[<v 2>@,You can convert @{<info>%s@} to @{<info>%s@} with @{<info>%s@}.@]" actual expected converter
40
+ fprintf ppf " @,@,@[<v 2>You can convert @{<info>%s@} to @{<info>%s@} with @{<info>%s@}.@]" actual expected converter
42
41
) with | Not_found -> ()
43
42
44
43
let print_simple_message ppf = function
@@ -135,7 +134,7 @@ let print_expr_type_clash env trace ppf =
135
134
(function ppf ->
136
135
fprintf ppf " This has type:" )
137
136
(function ppf ->
138
- fprintf ppf " But somewhere wanted:" );
137
+ fprintf ppf " Somewhere wanted:" );
139
138
show_extra_help ppf env trace;
140
139
end
141
140
@@ -178,21 +177,21 @@ let report_error env ppf = function
178
177
fprintf ppf " The variable %s on the left-hand side of this or-pattern has type" (Ident. name id))
179
178
(function ppf ->
180
179
fprintf ppf " but on the right-hand side it has type" )
181
- | Expr_type_clash (
180
+ | Expr_type_clash (
182
181
(_, {desc = Tarrow _}) ::
183
182
(_, {desc = Tconstr (Pdot (Pdot (Pident {name = " Js" }," Fn" ,_),_,_),_,_)}) :: _
184
- ) ->
185
- fprintf ppf " This function is a curried function where an uncurried function is expected"
183
+ ) ->
184
+ fprintf ppf " This function is a curried function where an uncurried function is expected"
186
185
| Expr_type_clash (
187
186
(_, {desc = Tconstr (Pdot (Pdot (Pident {name = " Js" }," Fn" ,_),a,_),_,_)}) ::
188
187
(_, {desc = Tconstr (Pdot (Pdot (Pident {name = " Js" }," Fn" ,_),b,_),_,_)}) :: _
189
- ) when a <> b ->
190
- fprintf ppf " This function has %s but was expected %s" a b
191
- | Expr_type_clash (
188
+ ) when a <> b ->
189
+ fprintf ppf " This function has %s but was expected %s" a b
190
+ | Expr_type_clash (
192
191
(_, {desc = Tconstr (Pdot (Pdot (Pident {name = " Js_OO" }," Meth" ,_),a,_),_,_)}) ::
193
192
(_, {desc = Tconstr (Pdot (Pdot (Pident {name = " Js_OO" }," Meth" ,_),b,_),_,_)}) :: _
194
- ) when a <> b ->
195
- fprintf ppf " This method has %s but was expected %s" a b
193
+ ) when a <> b ->
194
+ fprintf ppf " This method has %s but was expected %s" a b
196
195
197
196
| Expr_type_clash trace ->
198
197
(* modified *)
@@ -254,10 +253,10 @@ let report_error env ppf = function
254
253
fprintf ppf " it should have type@ %a@]"
255
254
type_expr ty
256
255
end else begin
257
- match ty with
258
- | {desc = Tconstr (Pdot (Pdot(Pident {name = "Js" } ,"Fn" ,_ ),_ ,_ ),_ ,_ )} ->
256
+ match ty with
257
+ | {desc = Tconstr (Pdot (Pdot(Pident {name = "Js" } ,"Fn" ,_ ),_ ,_ ),_ ,_ )} ->
259
258
fprintf ppf " This expression is excpeted to have an uncurried function"
260
- | _ ->
259
+ | _ ->
261
260
fprintf ppf " @[This expression should not be a function,@ " ;
262
261
fprintf ppf " the expected type is@ %a@]"
263
262
type_expr ty
0 commit comments