Analyzer issue regarding scoping of variables in if then else.
The following code yields a compile time error saying the a variable in the else body is not bounded.
some-strategy: _ -> a with if not(a:=1) then <debug> "a is not 1" else <debug> a end
However, if you remove the
Submitted by André Vieira on 28 January 2013 at 15:58not
and swap around the two branched statements this error no longer occurs. Also, if a is not bound in the else then it should not be bounded at the rewrite stage of the strategy (_ -> a
) but it is, because if we replace<debug> a
with<debug> "something else"
, the error is solved.
Log in to post comments