Open stklik opened 5 years ago
Original Bugreport (email from @gmarthe):
Dans le fichier SmartHome, la cellule ElectricPart affiche des erreurs incompréhensible (On a vérifié ensemble et il n'est écrit nulle part sun.light, donc la premiere erreur de la cellule n'a pas lieu d’être)
The following code causes issues in the Z3-translator, because the variable
light
is declared in both* branches. To solve, we have to declare the variable outside.In fact, the current implementation forbids any two variables with the same name.
Solution: The current solution is to declare a variable in an outside scope (e.g.
light = 0
on line 3). Thus, the original variable will be reassigned, instead of declared again.Potential issues: This doesn't work if you want to have the same variable name for values of different type (e.g. one
light
of typeREAL
and one of type string).elif ...:
aselse: if ... :