Using dialyzer with CB applications

43 views
Skip to first unread message

tome...@gmail.com

unread,
Feb 11, 2014, 4:29:50 AM2/11/14
to chica...@googlegroups.com
Hi!

Has anybody tried using dialyzer with CB applications?
It gives errors because CB uses parameterized modules.
Maybe someone has a workaround?

Cuong Thai

unread,
Feb 11, 2014, 5:55:18 AM2/11/14
to chica...@googlegroups.com, tome...@gmail.com
Hi tome,

Create plt/cb.plt, run make-plt.sh

#!/bin/bash
clear
PLT=plt/cb.plt
echo $PLT
#if [ ! -f $PLT ]; then
   dialyzer  --build_plt --apps kernel stdlib mnesia  inets ssl crypto \
       erts public_key runtime_tools compiler asn1 hipe gs\
       syntax_tools edoc xmerl public_key inets \
       --statistics\
       --output_plt $PLT
   rm deps/riak_core/ebin/*.beam
   echo "********************************************************************************"
   dialyzer --add_to_plt deps/*/ebin                                            --plt $PLT
   echo "********************************************************************************"
   echo ""
#fi

, then run dialyzer.sh

tome...@gmail.com

unread,
Feb 11, 2014, 10:15:49 AM2/11/14
to chica...@googlegroups.com, tome...@gmail.com
Thank you very much!

I generated cb.plt, but it gave a few warnings.
I enclose the output in case someone would like to fix it.

Checking whether the PLT plt/cb.plt is up-to-date... yes
  Compiling some key modules to native code... done in 0m52.15s
  Proceeding with analysis...
src/boss/boss_controller_compiler.erl:63: Function add_routes_to_forms/1 has no local return
src/boss/boss_controller_compiler.erl:66: The call boss_controller_compiler:add_routes_to_forms(Forms1::[{'attribute',_,'export' | 'module',_},...],[],[]) breaks the contract ([any()],[any()],[token_ast_cons(),...]) -> [any(),...]
src/boss/boss_doc.erl:19: The pattern 'ok' can never match the type 'error' | {'ok',atom()}
src/boss/boss_load.erl:53: Function load_all_modules/2 has no local return
src/boss/boss_load.erl:54: The call boss_load:load_all_modules(Application::any(),TranslatorSupPid::any(),'undefined') will never return since it differs in the 3rd argument from the success typing arguments: (atom(),atom() | pid() | {atom(),atom()},string())
src/boss/boss_load.erl:324: The pattern 'ok' can never match the type 'error' | {'ok',atom()} | {'error',[{[any()],[{'none' | integer(),atom(),_}]}],[{[any()],[{'none' | integer(),atom(),_}]}]} | {'ok',atom(),[{[any()],[{'none' | integer(),atom(),_}]}]}
src/boss/boss_web_controller.erl:40: Call to missing or unexported function cowboy:stop/0
src/boss/boss_web_test.erl:14: Function bootstrap_test_env/2 has no local return
src/boss/boss_web_test.erl:50: The created fun has no local return
src/boss/template_adapters/boss_template_adapter_erlydtl.erl:41: The pattern 'ok' can never match the type 'error' | {'ok',atom()} | {'error',[{_,_}],[{_,_}]} | {'ok',atom(),[{_,_}]}
Unknown functions:
  'Elixir.Boss.Repo.Sup':start_link/0
  'Elixir.EEx':compile_file/1
  'Elixir.Kernel.ParallelCompiler':files/1
  'Elixir.Kernel.ParallelCompiler':files_to_path/2
  elixir:translate_forms/3
  elixir_compiler:file/1
  eunit:test/1
  rebar_vsn_plugin:make_vsn/0
 done in 0m12.19s
done (warnings were emitted) 
Reply all
Reply to author
Forward
0 new messages