I’ve got the following code (greatly simplified):
L = get_leader(),
Me = get_me(),
A = case L of
Me ->
X = something_interesting_to_forestall_certain_answers(),
{ok, A} = make_assignments(X),
A;
_Other ->
Y = something_else_for_the_same_reason(),
{ok, A} = get_assignments(Y),
A
end
I get the warning variable 'A' exported from 'case'
. But it’s not really exported: the variable A
inside the case is hidden by the variable A
assigned to (and they’re actually the same value anyway). This is the case (heh) for every path.
Why does Erlang warn here? What can I do to make it happy?