We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f0621d commit 742b1c5Copy full SHA for 742b1c5
src/boot/fe/item.ml
@@ -1240,9 +1240,13 @@ and parse_use
1240
[| (ident, item) |]
1241
1242
and parse_item_decl ps items fn =
1243
- Array.iter
1244
- (fun (id,it) -> htab_put items id it)
1245
- (fn ps);
+ let add (id, item) =
+ if Hashtbl.mem items id then
+ raise (Parse_err
1246
+ (ps, (Printf.sprintf "item name already in use: '%s'" id)));
1247
+ Hashtbl.add items id item
1248
+ in
1249
+ Array.iter add (fn ps)
1250
1251
and parse_mod_header (ps:pstate)
1252
: (Ast.mod_view * Ast.mod_items) =
0 commit comments