We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce7be3b commit 33a893fCopy full SHA for 33a893f
src/compiler/compiler.ml
@@ -1435,9 +1435,10 @@ end = struct
1435
1436
let merge k a b =
1437
match a, b with
1438
- | _, Some (_,loc) -> Some loc
1439
- | Some _, b -> a
1440
- | _ -> anomaly ("ty_names collision: " ^ F.show k) in
+ | None, Some (_,loc) -> Some loc
+ | Some _, None -> a
+ | Some otherloc, Some (_,loc) -> error ~loc ("Duplicate type declaration: " ^ F.show k ^ ". Previous declaration: " ^ Loc.show otherloc)
1441
+ | _ -> assert false in
1442
let ty_names = F.Map.merge merge ty_names kinds in
1443
let all_ty_names = F.Map.merge merge all_ty_names kinds in
1444
let types = Type_checker.check_types ~type_abbrevs:all_type_abbrevs ~kinds:all_kinds types in
0 commit comments