Skip to content

Commit

Permalink
OTP 25 dialyzer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloRin committed Mar 20, 2024
1 parent 1c48a49 commit 9fcae23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion tools/rules_erlang_compiler/src/compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@
}).

-spec start_link(
atom(), file:filename_all(), #{atom() := target_extended()}, [string()], module_index(), inputs()
atom(),
file:filename_all(),
#{atom() := target_extended()},
[string()],
module_index(),
inputs()
) -> gen_server:start_ret().
start_link(AppName, AppDir, Targets, CodePaths, ModuleIndex, MappedInputs) ->
gen_server:start_link(
Expand Down
12 changes: 10 additions & 2 deletions tools/rules_erlang_compiler/src/executor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ execute(#{arguments := #{targets_file := ConfigJsonPath}, inputs := Inputs}) ->
end,
code:get_path()
),
code:del_paths(TheseCodePaths),
del_code_paths(TheseCodePaths),
lists:foreach(
fun
(thoas) ->
Expand Down Expand Up @@ -150,7 +150,7 @@ execute(#{arguments := #{targets_file := ConfigJsonPath}, inputs := Inputs}) ->
end,
Modules
),
code:del_paths(AbsCodePaths),
del_code_paths(AbsCodePaths),

#{hits := AH, misses := AM, size := AS} = cas:src_analysis_stats(),
ACR = 100 * AH / (AH + AM),
Expand Down Expand Up @@ -915,3 +915,11 @@ add_deps_to_targets(Targets, V, [E | Rest], G) ->
Target0
),
add_deps_to_targets(Targets#{Dependent := Target}, V, Rest, G).

-if(?OTP_RELEASE >= 26).
del_code_paths(Paths) ->
code:del_paths(Paths).
-else.
del_code_paths(Paths) ->
lists:foreach(fun code:del_path/1, Paths).
-endif.

0 comments on commit 9fcae23

Please sign in to comment.