Skip to content

Commit

Permalink
report an error when detect a circle in alias dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow committed Aug 23, 2024
1 parent 2a93e01 commit 6f431e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/typing/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ let reorg_ty_defs (defs : P.ty_def list) =
| Some neighber when List.memq neighber alias_defs ->
dfs graph cluster neighber
| _ -> cluster)
else if List.memq node cluster then
(* Find a node in current cluster => dircle detected! *)
failwith "Find a circle in alias dependency"
else cluster
in
let clusters =
Expand Down

0 comments on commit 6f431e0

Please sign in to comment.