Dialyzer: show success typing of a given function

Tobias Lindahl tobias.lindahl@REDACTED
Thu Jan 9 17:44:04 CET 2020


I used to build a plt for the system and then use the dialyzer_plt:pp_mod/1
on that one. It will probably only show the exported functions, though.

Otherwise, you will need to modify dialyzer to be able to find it.

At least originally, the plt was used to store all the intermediate
results, and if you can get your hands on it before it is deleted you can
look it up there. I remember that I removed the pruning of non-exported
function to get all functions in the plt dump. Back then it was a one-liner.

It appears that some things have changed in the 12 years since I left the
code base, though, so I can't give you a better indication than this.

Den tors 9 jan. 2020 kl 12:29 skrev Jesper Eskilson <
jesper.eskilson@REDACTED>:

> So, if I'm doing something like this:
>
> Errors = dialyzer:run(Options)
>
> how do I call dialyzer_plt:pp_mod(Mod), which seems to be looking inside
> an existing PLT file. I would like to show what dialyzer has discovered
> during the dialyzer:run/1 call.
>
> /Jesper
>
> On Thu, Jan 9, 2020 at 12:14 PM Jesper Eskilson <
> jesper.eskilson@REDACTED> wrote:
>
>> Thanks, I'll check it out.
>>
>> On Thu, Jan 9, 2020 at 11:40 AM Tobias Lindahl <tobias.lindahl@REDACTED>
>> wrote:
>>
>>> Jesper, I think you might want to have a look at the function
>>> dialyzer_plt:pp_mod/1
>>>
>>> I agree that there should be some command line option for this. I think
>>> I even had one at some point, but it seems to have got lost over time.
>>>
>>> Den ons 8 jan. 2020 kl 10:48 skrev Jesper Eskilson <
>>> jesper.eskilson@REDACTED>:
>>>
>>>> Thanks! I would've liked an option to dialyzer to do this (so I don't
>>>> need to replicate how I run dialyzer, which is sort of complicated). Also,
>>>> typer seems to require source code, and I would like to be able to do this
>>>> directly on the beams.
>>>>
>>>> /Jesper
>>>>
>>>> On Tue, Jan 7, 2020 at 2:21 PM Fernando Benavides <
>>>> elbrujohalcon@REDACTED> wrote:
>>>>
>>>>> You can use TypER for that, IIRC.
>>>>> Just remove your specs and run typer on your code, like you would run
>>>>> dialyzer.
>>>>> http://erlang.org/doc/man/typer.html
>>>>>
>>>>> On Tue, Jan 7, 2020 at 9:46 AM Jesper Eskilson <
>>>>> jesper.eskilson@REDACTED> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Often when I'm chasing down dialyzer errors, I want to see the
>>>>>> success typing of a function. Is there a way to do that?
>>>>>>
>>>>>> /Jesper
>>>>>> --
>>>>>>
>>>>>> *Jesper Eskilson*
>>>>>> Senior Software Engineer
>>>>>> Kred Core
>>>>>> +46-72-855-8421
>>>>>>
>>>>>> Klarna Bank AB (publ)
>>>>>> Sveavägen 46, 111 34 Stockholm
>>>>>> Tel: +46 8 120 120 00 <+46812012000>
>>>>>> Reg no: 556737-0431
>>>>>> klarna.com
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> <https://about.me/elbrujohalcon?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>>>> Brujo Benavides
>>>>> about.me/elbrujohalcon
>>>>> <https://about.me/elbrujohalcon?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Jesper Eskilson*
>>>> Senior Software Engineer
>>>> Kred Core
>>>> +46-72-855-8421
>>>>
>>>> Klarna Bank AB (publ)
>>>> Sveavägen 46, 111 34 Stockholm
>>>> Tel: +46 8 120 120 00 <+46812012000>
>>>> Reg no: 556737-0431
>>>> klarna.com
>>>>
>>>>
>>
>> --
>>
>> *Jesper Eskilson*
>> Senior Software Engineer
>> Kred Core
>> +46-72-855-8421
>>
>> Klarna Bank AB (publ)
>> Sveavägen 46, 111 34 Stockholm
>> Tel: +46 8 120 120 00 <+46812012000>
>> Reg no: 556737-0431
>> klarna.com
>>
>>
>
> --
>
> *Jesper Eskilson*
> Senior Software Engineer
> Kred Core
> +46-72-855-8421
>
> Klarna Bank AB (publ)
> Sveavägen 46, 111 34 Stockholm
> Tel: +46 8 120 120 00 <+46812012000>
> Reg no: 556737-0431
> klarna.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200109/88d94f18/attachment.htm>


More information about the erlang-questions mailing list