Dialyzer "no local return" warning for anonymous functions

Brian Candler B.Candler@REDACTED
Thu Dec 16 15:01:26 CET 2010


I'm no expert and don't have R14B01 around to test it, but would something
like this would work?

-spec no_return(fun()) -> fun(()->no_return()).
no_return(F) ->
  fun() -> F() end.

test(A, B) ->
  try
    ?MODULE:transaction(no_return(fun () -> my_funky_mnesia_test(A,B) end))
  catch
    exit:{aborted, all_valid} ->  ok;
    exit:{aborted, Error} ->  {error, Error}
  end.

(and maybe you could macro it out in production?)


More information about the erlang-questions mailing list