Skip to content

Commit 9701b09

Browse files
committed
khepri_path: Be more strict about arguments in realpath/2
[Why] This helps Dialyzer give more accurate warnings.
1 parent 4405c7a commit 9701b09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/khepri_path.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,10 @@ realpath([?PARENT_KHEPRI_NODE | Rest], [_ | Result]) ->
639639
realpath(Rest, Result);
640640
realpath([?PARENT_KHEPRI_NODE | Rest], [] = Result) ->
641641
realpath(Rest, Result);
642-
realpath([Component | Rest], Result) ->
642+
realpath([Component | Rest], Result)
643+
when is_atom(Component) orelse
644+
is_binary(Component) orelse
645+
?IS_KHEPRI_CONDITION(Component) ->
643646
realpath(Rest, [Component | Result]);
644647
realpath([], Result) ->
645648
lists:reverse(Result).

0 commit comments

Comments
 (0)