erl_eval:expr/5 oddity

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

erl_eval:expr/5 oddity

Leo Liu-2
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

_______________________________________________
erlang-bugs mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-bugs
Reply | Threaded
Open this post in threaded view
|

Re: erl_eval:expr/5 oddity

Leo Liu-2
Reported as https://bugs.erlang.org/browse/ERL-189

_______________________________________________
erlang-bugs mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-bugs
Reply | Threaded
Open this post in threaded view
|

Re: erl_eval:expr/5 oddity

Robert Virding
It is a bit strange as a lint test on the expression is only done for erl_eval:expr/2 and it is this which catches the error.

Robert


On 10 July 2016 at 12:40, Leo Liu <[hidden email]> wrote:
Reported as https://bugs.erlang.org/browse/ERL-189

_______________________________________________
erlang-bugs mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-bugs


_______________________________________________
erlang-bugs mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-bugs