[erlang-bugs] erl_eval:expr/5 oddity

Leo Liu sdl.web@REDACTED
Fri Jul 8 17:26:00 CEST 2016


Assume X is

{'if',1,
      [{clause,1,[],
               [[{op,1,'=:=',{var,1,'Filters'},{nil,1}}]],
               [{atom,1,true}]},
       {clause,1,[],[[{atom,1,true}]],[{atom,1,false}]}]}

which is the abstract format for

  if Filters =:= [] -> true; true -> false end.

1> erl_eval:expr(X, [], none, none, none).
=> false

2) erl_eval:expr(X, [])
=> ** exception error: {unbound_var,'Filters'}

bug?

Leo




More information about the erlang-bugs mailing list