basho / riak_core

Distributed systems infrastructure used by Riak.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type specs are wrong but don't run due to deprecated format [JIRA: RIAK-2811]

paulhenrich opened this issue · comments

@jvoegele and I found this while looking into the crash reported against riak_kv.

In riak_core_bucket, the type spec uses the old comment format and doesn't run. Additionally it doesn't reflect the actual behavior. In particular, the ok case doesn't return a tuple it just returns the Bucket Props. Also, the type definition for riak_core_bucket_props is out of date.

%% @spec get_bucket(riak_object:bucket()) ->
%%         {ok, BucketProps :: riak_core_bucketprops()} | {error,  no_type}

It should be something like:

-spec get_bucket(riak_object:bucket()) -> BucketProps :: riak_core_bucketprops() | {error,  no_type}.

which exits with a blank/unhelpful error when we run make dialyzer and we need to figure out what's actually going here.