[erlang-bugs] Regression? No warning on unused variable in try part of try..catch

Magnus Müller <>
Sun Nov 3 17:33:23 CET 2013


R16B02 does not output a warning when a variable within try..catch is
unused. Example:


no_warning() ->
    try X = 1
    catch _:_ -> ok

$ erlc try_catch.erl 
$ echo $?

In R15B03, a warning is written:

$ erlc try_catch.erl 
try_catch.erl:5: Warning: variable 'X' is unused

I tried the above with the `master` branch as well:

$ git log --oneline | head -n1
69a0e01 Merge branch 'maint
$ bin/erl
Erlang R17A (erts-5.11) [source-69a0e01] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.11  (abort with ^G)
1> c("../bugs/R16B02/try_catch.erl").


More information about the erlang-bugs mailing list