Skip to content

Commit 6435643

Browse files
committed
Dialyzer suppress per_common:to_bitstring/2
1 parent 92c4f5d commit 6435643

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lib/asn1/src/asn1ct_gen_per.erl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%%
22
%% %CopyrightBegin%
33
%%
4-
%% Copyright Ericsson AB 1997-2017. All Rights Reserved.
4+
%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
55
%%
66
%% Licensed under the Apache License, Version 2.0 (the "License");
77
%% you may not use this file except in compliance with the License.
@@ -47,14 +47,20 @@ dialyzer_suppressions(#gen{erule=per,aligned=Aligned}) ->
4747
false -> uper;
4848
true -> per
4949
end,
50-
case asn1ct_func:is_used({Mod,complete,1}) of
50+
suppress({Mod,complete,1}),
51+
suppress({per_common,to_bitstring,2}),
52+
emit([" ok.",nl]).
53+
54+
suppress({M,F,A}=MFA) ->
55+
case asn1ct_func:is_used(MFA) of
5156
false ->
5257
ok;
5358
true ->
54-
emit([" _ = complete(Arg),",nl])
55-
end,
56-
emit([" ok.",nl]).
57-
59+
Args =
60+
[lists:concat(["element(",I,", Arg)"])
61+
|| I <- lists:seq(1, A)],
62+
emit([" ",{call,M,F,Args},com,nl])
63+
end.
5864

5965
gen_encode(Erules,Type) when is_record(Type,typedef) ->
6066
gen_encode_user(Erules,Type).

0 commit comments

Comments
 (0)