From ca7d2d43a839ab284104edea4663ada52d2c3e23 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 24 Aug 2011 12:35:49 +0200 Subject: Improve and correct types and specifications in Kernel and STDLIB Running Dialyzer on the test suites revealed a few type errors. --- lib/stdlib/src/sofs.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/stdlib/src/sofs.erl') diff --git a/lib/stdlib/src/sofs.erl b/lib/stdlib/src/sofs.erl index d38b8ab37a..34eb224647 100644 --- a/lib/stdlib/src/sofs.erl +++ b/lib/stdlib/src/sofs.erl @@ -81,7 +81,8 @@ -define(ORDTAG, 'OrdSet'). -record(?TAG, {data = [] :: list(), type = type :: term()}). --record(?ORDTAG, {orddata = {} :: tuple(), ordtype = type :: term()}). +-record(?ORDTAG, {orddata = {} :: tuple() | atom(), + ordtype = type :: term()}). -define(LIST(S), (S)#?TAG.data). -define(TYPE(S), (S)#?TAG.type). @@ -375,7 +376,7 @@ to_sets(S) when ?IS_ORDSET(S) -> -spec(no_elements(ASet) -> NoElements when ASet :: a_set() | ordset(), - NoElements :: pos_integer()). + NoElements :: non_neg_integer()). no_elements(S) when ?IS_SET(S) -> length(?LIST(S)); no_elements(S) when ?IS_ORDSET(S), is_tuple(?ORDTYPE(S)) -> -- cgit v1.2.3