<div dir="ltr">On Wed, Nov 14, 2012 at 5:42 PM, Anthony Ramine <span dir="ltr"><<a href="mailto:n.oxyde@gmail.com" target="_blank">n.oxyde@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This patch implements EEP37: Funs with names<br><br></blockquote>
<div><br></div><div>It is now much closer to being graduated.</div><div><br></div><div>I have added the branch to our daily builds for the master branch.</div><div><br></div><div>I would like a comment from Kostis about the Dialyzer changes.</div>
<div><br></div><div>What also remains is coverage in test suites. I have fixed a few,</div><div>but xref_SUITE remains to be fixed (a named fun with the '_' name</div><div>should be tested).</div><div><br></div><div>
Here are my fixes for the test suites (also included as an attachment</div><div>to make it easier to apply):</div><div><br></div><div><div>diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl</div>
<div>index 0ff846e..e35692e 100644</div><div>--- a/lib/compiler/test/fun_SUITE.erl</div><div>+++ b/lib/compiler/test/fun_SUITE.erl</div><div>@@ -197,10 +197,14 @@ external(Config) when is_list(Config) -></div><div> call_me(I) -></div>
<div> {ok,I}.</div><div> </div><div>-id(I) -></div><div>- I.</div><div>-</div><div> eep37(Config) when is_list(Config) -></div><div> F = fun Fact(N) when N > 0 -> N * Fact(N - 1); Fact(0) -> 1 end,</div>
<div>+ Add = fun _(N) -> N + 1 end,</div><div>+ UnusedName = fun BlackAdder(N) -> N + 42 end,</div><div> 720 = F(6),</div><div>+ 10 = Add(9),</div><div>+ 50 = UnusedName(8),</div><div> ok.</div><div>
+</div><div>+id(I) -></div><div>+ I.</div><div>diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl</div><div>index 569af6c..75e3b55 100644</div><div>--- a/lib/debugger/test/fun_SUITE.erl</div>
<div>+++ b/lib/debugger/test/fun_SUITE.erl</div><div>@@ -288,10 +288,14 @@ external(Config) when is_list(Config) -></div><div> call_me(I) -></div><div> {ok,I}.</div><div> </div><div>-id(I) -></div><div>- I.</div>
<div>-</div><div> eep37(Config) when is_list(Config) -></div><div> F = fun Fact(N) when N > 0 -> N * Fact(N - 1); Fact(0) -> 1 end,</div><div>+ Add = fun _(N) -> N + 1 end,</div><div>+ UnusedName = fun BlackAdder(N) -> N + 42 end,</div>
<div> 720 = F(6),</div><div>+ 10 = Add(9),</div><div>+ 50 = UnusedName(8),</div><div> ok.</div><div>+</div><div>+id(I) -></div><div>+ I.</div><div>diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl</div>
<div>index ea90793..ad51bfa 100644</div><div>--- a/lib/stdlib/test/erl_lint_SUITE.erl</div><div>+++ b/lib/stdlib/test/erl_lint_SUITE.erl</div><div>@@ -644,7 +644,9 @@ unused_vars_warn_fun(Config) when is_list(Config) -></div>
<div> u() -></div><div> fun U(U) -> foo end; % U shadowed. U unused.</div><div> u() -></div><div>- fun U(1) -> U; U(U) -> foo end. % U shadowed. U unused.</div>
<div>+ fun U(1) -> U; U(U) -> foo end; % U shadowed. U unused.</div><div>+ u() -></div><div>+ fun _(N) -> N + 1 end. % Cover handling of '_' name.</div><div>
">>,</div><div> [warn_unused_vars],</div><div> {error,[{3,erl_lint,{unbound_var,'U'}}],</div></div><div><br></div><div><br></div><div>id/1 is a common help function, so I want it to remain at the end</div>
<div>of the file.</div></div><div><br></div><div>/Bjorn</div><div><br></div><div>-- <br></div>Björn Gustavsson, Erlang/OTP, Ericsson AB
</div></div>