Dialyzer and parametrized modules (semi-crash)
Brentley Jones
the.ajarn@REDACTED
Mon Jun 15 20:27:44 CEST 2009
First of all, I couldn't reply to my other post, so I'm sending this
one separate. (If someone can help me figure out how to add on to
another message I sent, it would be great).
Another bug with parametrized modules, this time dealing with the -
spec declaration.
When using a spec declaration in a parametrized module dialyzer will
semi-crash. (And before it's asked, I tried with many different specs,
the one below is just the simplest I could get it to show off the
error.)
This only happens when using a built PLT, as calling this with --
build_plt bring up no error:
$ dialyzer -c ebin --build_plt
Creating PLT /Users/Ajarn/.dialyzer_plt ... done in 0m0.24s
done (passed successfully)
$ dialyzer -c ebin
Checking whether the PLT /Users/Ajarn/.dialyzer_plt is up-to-
date... yes
Proceeding with analysis...
=ERROR REPORT==== 14-Jun-2009::10:54:31 ===
Error in process <0.30.0> with exit value: {function_clause,
[{dialyzer_plt,lookup,[{dialyzer_plt,{dict,13,16,16,8,80,48,{[],[],[],
[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[[{parameter,module_info,
1}|{{c,union,[{c,atom,any,unknown},none,none,none,{c,list,
[{c,tuple_set,[{2,[{c,tuple,[{c,atom...
dialyzer: Analysis failed with error: {function_clause,
[{dialyzer_plt,lookup,
[{dialyzer_plt,{dict,13,...},
{dict,...}},
{{param_w_spec,[...]},init,0}]},
{dialyzer_contracts,get_invalid_contract_warnings_funs,4},
{dialyzer_contracts,get_invalid_contract_warnings_modules,4},
{dialyzer_succ_typings,get_warnings,6},
{dialyzer_analysis_callgraph,analyze_callgraph,2},
{dialyzer_analysis_callgraph,analysis_start,2}]}
Last messages in the log cache:
Typesig analysis for SCC: [{parameter,instance,1}]
Typesig analysis for SCC: [{parameter,test,2}]
Typesig analysis for SCC: [{parameter,module_info,0}]
Typesig analysis for SCC: [{parameter,new,1}]
Typesig analysis for SCC: [{param_user,module_info,0}]
Typesig analysis for SCC: [{param_user,module_info,1}]
Typesig analysis for SCC: [{param_user,test,1}]
Dataflow of one SCC: [param_w_spec]
Dataflow of one SCC: [parameter]
Dataflow of one SCC: [param_user]
With the code below:
%% param_user.erl
-module(param_user).
-export([test/1]).
test(Module) ->
M = param_w_spec:new(Module),
M:init().
%% param_w_spec.erl
-module(param_w_spec, [X]).
-export([init/0]).
-spec(init/0 :: () -> any()).
init() ->
ok.
More information about the erlang-bugs
mailing list