[erlang-questions] Why is calendar not exporting its types?

Torben Hoffmann <>
Tue Oct 25 19:53:22 CEST 2011


It was dialyzer that went belly up on my input. I don't think the 
compiler uses the type annotations for anything except checking that 
they are syntactically correct.

The funny thing is that I only realised it when I ran dialyzer directly 
on one single beam file and then a bunch of skeletons came charging out 
the closet:

Unknown types:
  calendar:date/0
  calendar:datetime/0
  calendar:month/0
  calendar:t_date/0
  calendar:t_datetime/0
  calendar:year/0

Cheers,
Torben

On Tue Oct 25 17:00:02 2011, David Mercer wrote:
> On Tuesday, October 25, 2011, Torben Hoffmann wrote:
>
>> I have some code where I would like to annotate it with type
>> specfications, but all the nice types that calendar defines are not
>> exported. (t_now() is, but that is the only one).
>>
>> Right now I will define my own types for these, but it seems weird to
>> me
>> that the types are not exported from the calendar module.
>
> I didn't know that they weren't exported.  Just in the past day, I've been
> writing some code that uses the calendar module, annotating it with calendar
> types, but as far as I can tell, the compiler doesn't actually care if the
> type was actually exported or not.  Which downstream tool is going to throw
> the hissy-fit about it?  Dialyzer?
>
> Cheers,
>
> DBM
>



More information about the erlang-questions mailing list