Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ➜ cat my_test.hrl
- -type my_enum() :: atom1 |
- atom2 .
- -spec check(my_enum()) -> boolean().
- oleg@x200:~/dev
- ➜ cat my_test.erl
- -module(my_test).
- -include_lib("my_test.hrl").
- -export([check/1, do_test/0]).
- check(Data) ->
- io:format("data ~p~n", [Data]).
- do_test() ->
- check(atom1),
- check(bad),
- check(atom2).
- oleg@x200:~/dev
- ➜ erlc -d +debug_info -Wall my_test.erl
- erl +sbtu +A0 -noinput -mode minimal -boot start_clean -s erl_compile compile_cmdline -extra +debug_info -Wall my_test.erl
- oleg@x200:~/dev
- ➜ dialyzer --build_plt my_test.beam
- Creating PLT /home/oleg/.dialyzer_plt ...
- Unknown functions:
- erlang:get_module_info/1
- erlang:get_module_info/2
- io:format/2
- done in 0m0.34s
- done (passed successfully)
- oleg@x200:~/dev
- ➜ dialyzer --src my_test.erl
- Checking whether the PLT /home/oleg/.dialyzer_plt is up-to-date... yes
- Proceeding with analysis...
- my_test.erl:8: Function do_test/0 has no local return
- my_test.erl:10: The call my_test:check('bad') breaks the contract (my_enum()) -> boolean()
- Unknown functions:
- erlang:get_module_info/1
- erlang:get_module_info/2
- io:format/2
- done in 0m0.24s
- done (warnings were emitted)
- ➜ echo $?
- 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement