kuchu
kuchu

Reputation: 23

Dialyzer Warnings in erlang, Records construction and improper lists

I am trying to fix the warnings in erlang code found from dialyzer. i came across few errors like record construction and improper lists what causes these errors. can anyone explain it.

thank you!

Upvotes: -1

Views: 178

Answers (1)

7stud
7stud

Reputation: 48599

Proper list:

[1|[2]]

Improper list:

[1|2]

...which could result from defining a function like this:

f([H|[]]) -> H-1;
f([H|T]) -> [H - 1 | f(T) ].

instead of:

f([H|[]]) -> [H-1];
f([H|T]) -> [H - 1 | f(T) ].

Record construction error:

http://erlang.org/pipermail/erlang-questions/2013-June/074118.html.

I do not get that record construction error in erlang 20.2.

Upvotes: 0

Related Questions