[erlang-patches] Re: Fix translation of fun((...) -> T) type

Henrik Nord henrik@REDACTED
Thu Apr 7 11:05:31 CEST 2011


On 03/30/2011 01:06 PM, Kostis Sagonas wrote:
> Fix the translation of fun((...) -> T) type so that it can be 
> processed by type manipulating tools that rely on erl_types.erl
>
>   git fetch git://github.com/kostis/otp.git any-arity-fun
>
> Thanks to Andreas Hohwü-Christensen for reporting this!
>
> Kostis
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches

Rejected.

The problem is not just that stdlib/src/erl_pp.erl and
edoc/src/edoc_specs.erl recognize the exact tuple {type,Line,any}
(this could be "fixed" but probably not a a minor release).

No, the real problem is that the proposed tuple already has a meaning.

Pretty-printing (with modified erl_parse.yrl and erl_lint.erl)

   -type t() :: 'fun'(any(), atom()).
   -type u() :: fun((...) ->  atom()).

shows that they will be printed like this:

   -type t() :: 'fun'(any(), atom()).
   -type u() :: 'fun'(any(), atom()).

[Pretty-printing is done using the compiler's 'P' option.]



-- 
/Henrik Nord Erlang/OTP




More information about the erlang-patches mailing list