lpgauth/cassanderl — pull request #19 by ferd (2013-02-26 22:05:41+00:00)
Title: Type specs fixes.

This patch comes in two parts:

1. Updating dispcount to fix a type spec error
2. Relaxing the record type specifications (explanation below).

When certain optional record fields are left to the default value of
'undefined', Dialyzer complains about contracts breaking. This is the
same kind of error reported in issue #12.

Most significantly, records that are *meant* to have undefined fields
such as the following one:

#columnOrSuperColumn{column = undefined,
super_column = undefined,
counter_column = CColumn,
counter_super_column = undefined}

Will get the same problem. This is because the .hrl file uses
a notation forcing a type with an incompatible default value:

field = undefined :: Type

Whereas using:

field :: Type

In both cases, an uninstantiated field will have the value 'undefined'.
The difference is that Dialyzer will insert an implicit 'undefined'
union to the type mentioned when no default value is noted:

field :: 'undefined' | Type

but will avoid adding this implicit annotation when a default value is
provided explicitly.

This patch thus removes the explicit '= undefined' default value so that
Dialyzer quits complaining.