rabbitmq/erlando

Unused variable compiler warnings

Closed this issue · 3 comments

Unused variable compiler warnings

compile: warnings being treated as errors
test/src/test_do.erl:185: variable 'A' is unused
test/src/test_do.erl:186: variable 'A' is unused
test/src/test_do.erl:187: variable 'A' is unused

Please see the commit below for (one possible) a fix.

https://github.com/norton/erlando/commit/346b37e05e1347f11c98414554e95653a1d3be0a

Thanks for the report. I had seen the issue but decided I didn't care enough. But I've clearly spent far too long in JavaScript recently and not enough time in Erlang as I'd forgotten about the mis-feature of _A actually getting bound. Thus I've applied your suggested fix. Many thanks.

Ok, glad it helped.

I'd recommend adding to the rebar.config file:

  %% -*- erlang -*-
  {erl_opts, [debug_info, warnings_as_errors]}.

The warnings_as_errors will help find these issues at compile time.

Ok, thanks, I've done that. I don't use rebar myself so never touch the rebar.config. Thanks for the suggestion though.