File tree Expand file tree Collapse file tree 6 files changed +44
-22
lines changed Expand file tree Collapse file tree 6 files changed +44
-22
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,17 @@ let rec check_duplicated_labels_aux
73
73
| {pld_name = ({txt} as pld_name ); pld_attributes} ::rest ->
74
74
if String_set. mem coll txt then Some pld_name
75
75
else
76
- let coll = String_set. add coll txt in
76
+ let coll_with_lbl = String_set. add coll txt in
77
77
match Ext_list. find_opt pld_attributes find_name_with_loc with
78
- | None -> check_duplicated_labels_aux rest coll
78
+ | None -> check_duplicated_labels_aux rest coll_with_lbl
79
79
| Some ({txt = s ;} as l ) ->
80
- if String_set. mem coll s then
80
+ if String_set. mem coll s
81
+ (* use coll to make check a bit looser
82
+ allow cases like [ x : int [@bs.as "x"]]
83
+ *) then
81
84
Some l
82
85
else
83
- check_duplicated_labels_aux rest (String_set. add coll s)
86
+ check_duplicated_labels_aux rest (String_set. add coll_with_lbl s)
84
87
85
88
let check_duplicated_labels lbls =
86
89
check_duplicated_labels_aux lbls String_set. empty
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ and obj = {
64
64
65
65
let f4 ({ x; y; z = {hi } } : entry ) =
66
66
(x + y + hi) * 2
67
-
67
+
68
+
68
69
#if 0 then
69
70
type t5 = {
70
71
x : int ;
@@ -73,4 +74,10 @@ type t5 = {
73
74
}
74
75
75
76
let v5 = {x = 3 ; y = 2 }
76
- #end
77
+ #end
78
+
79
+ type t6 = {
80
+ x : int [@ bs.as "x" ];
81
+ y : int [@ bs.as "y" ]
82
+ }
83
+ (* allow this case *)
Original file line number Diff line number Diff line change @@ -28010,14 +28010,17 @@ let rec check_duplicated_labels_aux
28010
28010
| {pld_name= ({txt} as pld_name); pld_attributes}::rest ->
28011
28011
if String_set.mem coll txt then Some pld_name
28012
28012
else
28013
- let coll = String_set.add coll txt in
28013
+ let coll_with_lbl = String_set.add coll txt in
28014
28014
match Ext_list.find_opt pld_attributes find_name_with_loc with
28015
- | None -> check_duplicated_labels_aux rest coll
28015
+ | None -> check_duplicated_labels_aux rest coll_with_lbl
28016
28016
| Some ({txt = s;} as l) ->
28017
- if String_set.mem coll s then
28017
+ if String_set.mem coll s
28018
+ (*use coll to make check a bit looser
28019
+ allow cases like [ x : int [@bs.as "x"]]
28020
+ *) then
28018
28021
Some l
28019
28022
else
28020
- check_duplicated_labels_aux rest (String_set.add coll s)
28023
+ check_duplicated_labels_aux rest (String_set.add coll_with_lbl s)
28021
28024
28022
28025
let check_duplicated_labels lbls =
28023
28026
check_duplicated_labels_aux lbls String_set.empty
Original file line number Diff line number Diff line change @@ -56189,14 +56189,17 @@ let rec check_duplicated_labels_aux
56189
56189
| {pld_name= ({txt} as pld_name); pld_attributes}::rest ->
56190
56190
if String_set.mem coll txt then Some pld_name
56191
56191
else
56192
- let coll = String_set.add coll txt in
56192
+ let coll_with_lbl = String_set.add coll txt in
56193
56193
match Ext_list.find_opt pld_attributes find_name_with_loc with
56194
- | None -> check_duplicated_labels_aux rest coll
56194
+ | None -> check_duplicated_labels_aux rest coll_with_lbl
56195
56195
| Some ({txt = s;} as l) ->
56196
- if String_set.mem coll s then
56196
+ if String_set.mem coll s
56197
+ (*use coll to make check a bit looser
56198
+ allow cases like [ x : int [@bs.as "x"]]
56199
+ *) then
56197
56200
Some l
56198
56201
else
56199
- check_duplicated_labels_aux rest (String_set.add coll s)
56202
+ check_duplicated_labels_aux rest (String_set.add coll_with_lbl s)
56200
56203
56201
56204
let check_duplicated_labels lbls =
56202
56205
check_duplicated_labels_aux lbls String_set.empty
Original file line number Diff line number Diff line change @@ -56189,14 +56189,17 @@ let rec check_duplicated_labels_aux
56189
56189
| {pld_name= ({txt} as pld_name); pld_attributes}::rest ->
56190
56190
if String_set.mem coll txt then Some pld_name
56191
56191
else
56192
- let coll = String_set.add coll txt in
56192
+ let coll_with_lbl = String_set.add coll txt in
56193
56193
match Ext_list.find_opt pld_attributes find_name_with_loc with
56194
- | None -> check_duplicated_labels_aux rest coll
56194
+ | None -> check_duplicated_labels_aux rest coll_with_lbl
56195
56195
| Some ({txt = s;} as l) ->
56196
- if String_set.mem coll s then
56196
+ if String_set.mem coll s
56197
+ (*use coll to make check a bit looser
56198
+ allow cases like [ x : int [@bs.as "x"]]
56199
+ *) then
56197
56200
Some l
56198
56201
else
56199
- check_duplicated_labels_aux rest (String_set.add coll s)
56202
+ check_duplicated_labels_aux rest (String_set.add coll_with_lbl s)
56200
56203
56201
56204
let check_duplicated_labels lbls =
56202
56205
check_duplicated_labels_aux lbls String_set.empty
Original file line number Diff line number Diff line change @@ -41637,14 +41637,17 @@ let rec check_duplicated_labels_aux
41637
41637
| {pld_name= ({txt} as pld_name); pld_attributes}::rest ->
41638
41638
if String_set.mem coll txt then Some pld_name
41639
41639
else
41640
- let coll = String_set.add coll txt in
41640
+ let coll_with_lbl = String_set.add coll txt in
41641
41641
match Ext_list.find_opt pld_attributes find_name_with_loc with
41642
- | None -> check_duplicated_labels_aux rest coll
41642
+ | None -> check_duplicated_labels_aux rest coll_with_lbl
41643
41643
| Some ({txt = s;} as l) ->
41644
- if String_set.mem coll s then
41644
+ if String_set.mem coll s
41645
+ (*use coll to make check a bit looser
41646
+ allow cases like [ x : int [@bs.as "x"]]
41647
+ *) then
41645
41648
Some l
41646
41649
else
41647
- check_duplicated_labels_aux rest (String_set.add coll s)
41650
+ check_duplicated_labels_aux rest (String_set.add coll_with_lbl s)
41648
41651
41649
41652
let check_duplicated_labels lbls =
41650
41653
check_duplicated_labels_aux lbls String_set.empty
You can’t perform that action at this time.
0 commit comments