[erlang-questions] erl_tidy:file gives surprising output for -spec or -type

Sean Cribbs sean@REDACTED
Mon Sep 8 01:11:31 CEST 2014


erl_syntax doesn't understand -type or -spec either. I'm tempted to
write a patch since I'll be needing to generate -spec entries soon.

On Sun, Sep 7, 2014 at 5:55 PM, Leo Liu <sdl.web@REDACTED> wrote:
> running erl_tidy:file/1 on the attached file gives me:
>
> --8<---------------cut here---------------start------------->8---
> [snipped 7 lines]
>
> -type({filename_all,
>        {type, 7, union,
>         [{type, 7, string, []}, {type, 7, binary, []}]},
>        []}).
>
> -spec({{pid2name, 1},
>        [{type, 9, bounded_fun,
>          [{type, 9, 'fun',
>            [{type, 9, product, [{var, 9, 'Pid'}]},
>             {type, 9, union,
>              [{type, 9, tuple,
>                [{atom, 9, ok}, {var, 9, 'Filename'}]},
>               {atom, 9, undefined}]}]},
>           [{type, 10, constraint,
>             [{atom, 10, is_subtype},
>              [{var, 10, 'Filename'},
>               {user_type, 10, filename_all, []}]]},
>            {type, 11, constraint,
>             [{atom, 11, is_subtype},
>              [{var, 11, 'Pid'}, {type, 11, pid, []}]]}]]}]}).
>
> [snipped 9 lines]
> --8<---------------cut here---------------end--------------->8---
>
> Is this a bug or feature? Thanks, Leo
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Sean Cribbs <sean@REDACTED>
Software Engineer
Basho Technologies, Inc.
http://basho.com/



More information about the erlang-questions mailing list