Accessing typespecs from a module

78 views
Skip to first unread message

eksperimental

unread,
May 8, 2016, 10:43:52 PM5/8/16
to elixir-l...@googlegroups.com
I'm trying to fix this bug.
https://github.com/elixir-lang/elixir/pull/4582/files#r62423420

I'm trying to see how can I access a module type (Inspect.Opt.t/0 in
this case), but I cannot seem to find anything suitable in
Kernel.Typespec

If anybody knows an easy way (other than parsing the beam file), It
will be appreciated.

if not, Jose, is it ok to read from the beam file?
cheers

José Valim

unread,
May 9, 2016, 2:57:34 AM5/9/16
to elixir-l...@googlegroups.com
It is not OK to read from the BEAM file. Typespecs are annotations, we are not supposed to rely on it during runtime, you will need to repeat the definition in your typespecs in your code as well.



José Valim
Skype: jv.ptec
Founder and Director of R&D


--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/20160509094345.06f790b2.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.

eksperimental

unread,
May 9, 2016, 10:54:23 AM5/9/16
to elixir-l...@googlegroups.com
Thanks for answer José,
Not to happy about the solution,
because that will require that when code gets updated, we will have to
duplicate the changes, and we may forget to do that.

Is this a feature that could be added to Elixir, or its not there due
to technical limitations?


On Mon, 9 May 2016 08:57:13 +0200
José Valim <jose....@plataformatec.com.br> wrote:

> It is not OK to read from the BEAM file. Typespecs are annotations,
> we are not supposed to rely on it during runtime, you will need to
> repeat the definition in your typespecs in your code as well.
>
>
>
> *José Valim*
Reply all
Reply to author
Forward
0 new messages