dlialyzer a bit too sceptic?

Tobias Lindahl Tobias.Lindahl@REDACTED
Wed Jun 21 18:55:49 CEST 2006


This seems very strange to me too. Can you send me the module (offline 
from the list) so that I can have a look?

By the way, which version of Dialyzer is this?

Tobias


Ulf Wiger (AL/EAB) wrote:
> Dialyzer (R11B-0) gave me the following warning on some 'rdbms' code:
> 
> {rdbms_groups,'-do_add_members/2-fun-0-',2}: Call to function
> {rdbms_props,do_write_property,2} with signature ((_,{{'acl',atom()} |
> {'typedef',_} | {'attr',_,_} | 'access_module' | 'acl' | 'indexes' |
> 'read_filter' | 'rec_type' | 'references' | 'write_filter',_}) -> 'ok')
> will fail since the arguments are of type
> ('schema',{{'group',_,'membership'},_})!
> 
> 
> But the function rdbms_props:do_write_property/2 looks like this:
> 
> 
> do_write_property(Tab, Prop) ->
>     mnesia_schema:do_write_table_property(Tab, Prop).
> 
> 
> I.e. absolutely no restrictions on Prop. If one were to introduce one,
> it would be something similar to that of
> mnesia_schema:write_table_property/2 - namely that Prop is a tuple with
> at least one element.
> 
> 
> write_table_property(Tab, Prop) when tuple(Prop), size(Prop) >= 1 ->
>     schema_transaction(fun() -> do_write_table_property(Tab, Prop) end);
> write_table_property(Tab, Prop) ->
>     {aborted, {bad_type, Tab, Prop}}.
> 
> do_write_table_property(Tab, Prop) ->
>     TidTs = get_tid_ts_and_lock(schema, write),
>     {_, _, Ts} = TidTs,
>     Store = Ts#tidstore.store,
>     case change_prop_in_existing_op(Tab, Prop, write_property, Store) of
> 	true ->
> 	    ...
> 	    %% we have merged the table prop into the create_table op
> 	    ok;
> 	false ->
> 	    ...,
> 	    insert_schema_ops(TidTs, make_write_table_properties(Tab,
> [Prop]))
>     end.
> 
> 
> It's not at all clear to me why Dialyzer thinks the call would fail.
> 
> BR,
> Ulf W



More information about the erlang-questions mailing list