[erlang-questions] code:lib_dir and dialyzer

Nicolas Charpentier <>
Thu Jan 8 08:11:13 CET 2009


Hi,

Kostis Sagonas wrote:
>>...
> In some sense yes, but I would really describe/classify this as an 
> inconsistency more than a bug.
> 
> The problem is that Dialyzer (still) has hard-coded information about 
> some library functions in hipe/cerl/erl_bif_types.erl.  This information 
> pre-dates the language of contracts and shadows the -spec information.
> For the function in question dialyzer knows that:
> 
> arg_types(code, lib_dir, 1) ->
>   [t_atom()];
> 
> which explains why you get the error message that you get.  Now that 
> contracts are present in code, arguably this information is no longer 
> needed and can (should?) be taken out -- at least for functions of this 
> module.
> 

> Regardless, I would suggest that you fix your code to adhere to the 
> published documentation and use code:lib_dir/1 with a string() instead.
> 

Thanks for your answer.
Of course that my code need to be fix to match the 
documentation/contracts, I was just worried that this 'error report 
confusion' could occurred on my code too.

----
Nicolas Charpentier
http://charpi.net



More information about the erlang-questions mailing list