Community
Participate
Working Groups
consider var a = 0; var b = 10/a; The constant evaluator does not treat variables as having constant value. To do this there is the need to investigate the "evaluation path" between the variable definition and the use of the variable. The constant evaluator can not currently do this. The var scope provider performs a search "up the scope chain" in a fashion similar to what is needed in evalConstant(BVariableExpression o) where a search is needed from "o" up it's containment chain until it finds the instance referenced by o.getNamedValue(). The search is non trivial var a = 0; switch someFuction() case someOtherFunction() : a = 0 case false: a = 0 endswitch; var b = 10/a; Here a is still 0 even if assigned (both assignments are constant and to 0). The query would need to answer: for all possible evaluations between o and the named value, does the evaluation change the value to something different than its initial value.
Although nice to have, not the most important enhancement - changed to P4.