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

Leo Liu sdl.web@REDACTED
Mon Sep 8 00:55:35 CEST 2014


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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug.erl
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140908/4b75535f/attachment.ksh>


More information about the erlang-questions mailing list