File tree Expand file tree Collapse file tree 8 files changed +29
-21
lines changed
build_tests/super_errors/expected Expand file tree Collapse file tree 8 files changed +29
-21
lines changed Original file line number Diff line number Diff line change 1
1
2
2
[1;31mWe've found a bug for you![0m
3
- [36m/.../fixtures/method_arity_mismatch.re[0m [2m3:8-9 [0m
3
+ [36m/.../fixtures/method_arity_mismatch.re[0m [2m3:5-11 [0m
4
4
5
5
1 [2m│[0m let f = ( obj ) => {
6
6
2 [2m│[0m obj##hi (1,2);
7
- [1;31m3[0m [2m│[0m obj [1;31m##[0mhi (1)
7
+ [1;31m3[0m [2m│[0m [1;31mobj##hi[0m (1)
8
8
4 [2m│[0m }
9
9
10
10
This method has arity2 but was expected arity1
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ let check_and_discard (args : Ast_compatible.args) =
51
51
52
52
type app_pattern = {
53
53
op : string ;
54
- loc : Location .t ;
54
+ loc : Location .t ; (* locatoin is the location of whole expression #4451 *)
55
55
args : Parsetree .expression list
56
56
}
57
57
@@ -62,10 +62,10 @@ let sane_property_name_check loc s =
62
62
(* match fn as *)
63
63
let view_as_app (fn : exp ) s : app_pattern option =
64
64
match fn.pexp_desc with
65
- | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; loc }}, args )
65
+ | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; _ }}, args )
66
66
when Ext_list. has_string s op
67
67
->
68
- Some {op; loc; args = check_and_discard args}
68
+ Some {op; loc = fn.pexp_loc ; args = check_and_discard args}
69
69
| _ -> None
70
70
71
71
Original file line number Diff line number Diff line change @@ -10955,9 +10955,13 @@ let clean_re_js root =
10955
10955
| None -> Set_string.empty
10956
10956
in
10957
10957
let gentype_language =
10958
- match Map_string.find_opt map Bsb_build_schemas.language with
10958
+ match Map_string.find_opt map Bsb_build_schemas.gentypeconfig with
10959
10959
| None -> ""
10960
- | Some (Str {str}) -> str
10960
+ | Some (Obj { map }) ->
10961
+ (match Map_string.find_opt map Bsb_build_schemas.language with
10962
+ | None -> ""
10963
+ | Some (Str {str}) -> str
10964
+ | Some _ -> "")
10961
10965
| Some _ -> ""
10962
10966
in
10963
10967
Ext_option.iter (Map_string.find_opt map Bsb_build_schemas.sources) begin fun config ->
Original file line number Diff line number Diff line change @@ -10987,9 +10987,13 @@ let clean_re_js root =
10987
10987
| None -> Set_string.empty
10988
10988
in
10989
10989
let gentype_language =
10990
- match Map_string.find_opt map Bsb_build_schemas.language with
10990
+ match Map_string.find_opt map Bsb_build_schemas.gentypeconfig with
10991
10991
| None -> ""
10992
- | Some (Str {str}) -> str
10992
+ | Some (Obj { map }) ->
10993
+ (match Map_string.find_opt map Bsb_build_schemas.language with
10994
+ | None -> ""
10995
+ | Some (Str {str}) -> str
10996
+ | Some _ -> "")
10993
10997
| Some _ -> ""
10994
10998
in
10995
10999
Ext_option.iter (Map_string.find_opt map Bsb_build_schemas.sources) begin fun config ->
Original file line number Diff line number Diff line change @@ -407641,7 +407641,7 @@ let check_and_discard (args : Ast_compatible.args) =
407641
407641
407642
407642
type app_pattern = {
407643
407643
op : string;
407644
- loc : Location.t;
407644
+ loc : Location.t; (* locatoin is the location of whole expression #4451 *)
407645
407645
args : Parsetree.expression list
407646
407646
}
407647
407647
@@ -407652,10 +407652,10 @@ let sane_property_name_check loc s =
407652
407652
(* match fn as *)
407653
407653
let view_as_app (fn : exp) s : app_pattern option =
407654
407654
match fn.pexp_desc with
407655
- | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; loc }}, args )
407655
+ | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; _ }}, args )
407656
407656
when Ext_list.has_string s op
407657
407657
->
407658
- Some {op; loc; args = check_and_discard args}
407658
+ Some {op; loc = fn.pexp_loc ; args = check_and_discard args}
407659
407659
| _ -> None
407660
407660
407661
407661
Original file line number Diff line number Diff line change @@ -407641,7 +407641,7 @@ let check_and_discard (args : Ast_compatible.args) =
407641
407641
407642
407642
type app_pattern = {
407643
407643
op : string;
407644
- loc : Location.t;
407644
+ loc : Location.t; (* locatoin is the location of whole expression #4451 *)
407645
407645
args : Parsetree.expression list
407646
407646
}
407647
407647
@@ -407652,10 +407652,10 @@ let sane_property_name_check loc s =
407652
407652
(* match fn as *)
407653
407653
let view_as_app (fn : exp) s : app_pattern option =
407654
407654
match fn.pexp_desc with
407655
- | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; loc }}, args )
407655
+ | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; _ }}, args )
407656
407656
when Ext_list.has_string s op
407657
407657
->
407658
- Some {op; loc; args = check_and_discard args}
407658
+ Some {op; loc = fn.pexp_loc ; args = check_and_discard args}
407659
407659
| _ -> None
407660
407660
407661
407661
Original file line number Diff line number Diff line change @@ -22153,7 +22153,7 @@ let check_and_discard (args : Ast_compatible.args) =
22153
22153
22154
22154
type app_pattern = {
22155
22155
op : string;
22156
- loc : Location.t;
22156
+ loc : Location.t; (* locatoin is the location of whole expression #4451 *)
22157
22157
args : Parsetree.expression list
22158
22158
}
22159
22159
@@ -22164,10 +22164,10 @@ let sane_property_name_check loc s =
22164
22164
(* match fn as *)
22165
22165
let view_as_app (fn : exp) s : app_pattern option =
22166
22166
match fn.pexp_desc with
22167
- | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; loc }}, args )
22167
+ | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; _ }}, args )
22168
22168
when Ext_list.has_string s op
22169
22169
->
22170
- Some {op; loc; args = check_and_discard args}
22170
+ Some {op; loc = fn.pexp_loc ; args = check_and_discard args}
22171
22171
| _ -> None
22172
22172
22173
22173
Original file line number Diff line number Diff line change @@ -411380,7 +411380,7 @@ let check_and_discard (args : Ast_compatible.args) =
411380
411380
411381
411381
type app_pattern = {
411382
411382
op : string;
411383
- loc : Location.t;
411383
+ loc : Location.t; (* locatoin is the location of whole expression #4451 *)
411384
411384
args : Parsetree.expression list
411385
411385
}
411386
411386
@@ -411391,10 +411391,10 @@ let sane_property_name_check loc s =
411391
411391
(* match fn as *)
411392
411392
let view_as_app (fn : exp) s : app_pattern option =
411393
411393
match fn.pexp_desc with
411394
- | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; loc }}, args )
411394
+ | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident op; _ }}, args )
411395
411395
when Ext_list.has_string s op
411396
411396
->
411397
- Some {op; loc; args = check_and_discard args}
411397
+ Some {op; loc = fn.pexp_loc ; args = check_and_discard args}
411398
411398
| _ -> None
411399
411399
411400
411400
You can’t perform that action at this time.
0 commit comments