1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

Improve detection of types in odbc

This should fix issue with dialyzer on erlang 26.2.3+
This commit is contained in:
Paweł Chmielowski 2024-03-18 14:54:32 +01:00
parent 8f20dd8425
commit 537aac24f7
4 changed files with 43 additions and 7 deletions

View file

@ -151,6 +151,30 @@ ProcessVars = fun F([], Acc) ->
false ->
F(Tail, Acc)
end;
F([{Type, {Mod, TypeDef}, Value} | Tail], Acc) when
Type == if_type_exported orelse
Type == if_type_not_exported ->
try
{ok, Concrete} = dialyzer_utils:get_core_from_beam(code:which(Mod)),
{ok, Types} = dialyzer_utils:get_record_and_type_info(Concrete),
maps:get(TypeDef, Types, undefined)
of
undefined when Type == if_type_not_exported ->
F(Tail, ProcessSingleVar(F, Value, Acc));
undefined ->
F(Tail, Acc);
_ when Type == if_type_exported ->
F(Tail, ProcessSingleVar(F, Value, Acc));
_ ->
F(Tail, Acc)
catch _:_ ->
if
Type == if_type_not_exported ->
F(Tail, ProcessSingleVar(F, Value, Acc));
true ->
F(Tail, Acc)
end
end;
F([Other1 | Tail1], Acc) ->
F(Tail1, [F(Other1, []) | Acc]);
F(Val, Acc) when is_tuple(Val) ->