[erlang-questions] dialyzer: warning when calling fun() from a record()

Jean-Sébastien Pédron <>
Wed Nov 21 15:39:45 CET 2012


Hi!

I made two small programs to isolate an issue I encounter with Dialyzer.
The purpose is to call a fun() given as a function argument.

The first program, "call_fun_ok.erl", has a function which takes the
fun() as a separate argument and dialyzer is happy with that.

The second program, "call_fun_fail.erl", has a function which takes the
fun() from a record() given as argument. This time, dialyzer complains
with the following warning:
  Fun application with arguments (call_fun_fail:state()) will fail
  since the function has type
   fun((call_fun_fail:state()) -> call_fun_fail:state())

Both programs otherwise work the same. This was tested with Erlang
R15B02 and Git revision d30cee99 (branch "master").

I've attached both modules source code to this mail.

Does someone see a problem with my code in "call_fun_fail.erl"?

Thanks!

-- 
Jean-Sébastien Pédron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: call_fun_ok.erl
Type: text/x-erlang
Size: 494 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121121/9295711e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: call_fun_fail.erl
Type: text/x-erlang
Size: 486 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121121/9295711e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121121/9295711e/attachment-0002.bin>


More information about the erlang-questions mailing list