[erlang-questions] Typespecs export not working as intended?

Eric Merritt ericbmerritt@REDACTED
Mon Apr 18 15:31:26 CEST 2011


Loïc,

This is expected behaviour. You get the exact same behaviour with
function calls. Basically, the remote types are not checked until
evaluation time. In this case, that is when dialyzer or some other
tool goes through and makes use of the specs. Erlang is a late binding
language, both in function call and type references.

Eric

On Mon, Apr 18, 2011 at 6:03 AM, Loïc Hoguin <essen@REDACTED> wrote:
> Hello,
>
> I have ran into a weird issue while refactoring the type specs in a project.
>
> It seems types in a module can be used even if they are not exported
> using export_type. Neither of the compiler or dialyzer are complaining
> about it.
>
> For example, module a declares a type my_type(), module b uses it with
> a:my_type(), no export_type in module, yet it still works.
>
> Is that normal? The documentation clearly states that types should be
> exported.
>
> --
> Loïc Hoguin
> Dev:Extend
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list