[erlang-bugs] illegal declaration of pertially defined record types in dialyzer, R14A

Vincent de Phily <>
Mon Sep 13 10:37:01 CEST 2010

On Tuesday 31 August 2010 16:03:38 Nico Kruber wrote:
> The type I use now is defined opaque but every method in the according
> module gets well-formed records, i.e. no 'undefined' fields. I cannot
> provide useful initialisers though because we store pids, for example.
> We not have to distinguish well-formed records and those that may be
> partially undefined and the given declaration would solve this problem.

What I do in those cases is to set a throw()n value as the default value. It's 
not 100% satisfying but it solves a few problems :

-define(required(Record, Field), throw({record_field_required, Record, Field, 

-record(file, {size = ?required(file, size) :: integer()}).

Vincent de Phily

More information about the erlang-bugs mailing list