Skip to content
Permalink
Browse files
Fix incorrect ivar redefined error message in loops.
  • Loading branch information
PseudoKnight committed May 22, 2020
1 parent 64bc095 commit 52316a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
@@ -290,7 +290,7 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
MSLog.GetLogger().Log(MSLog.Tags.RUNTIME, LogLevel.ERROR,
"The variable " + name + " is hiding another value of the"
+ " same name in the main scope.", t);
} else {
} else if(t == Target.UNKNOWN || t != list.get(name, t, true, env).getDefinedTarget()) {
MSLog.GetLogger().Log(MSLog.Tags.RUNTIME, LogLevel.ERROR, name + " was already defined at "
+ list.get(name, t, true, env).getDefinedTarget() + " but is being redefined.", t);
}
@@ -638,7 +638,7 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
if(v.ival() instanceof CMutablePrimitive) {
newVal = ((CMutablePrimitive) v.ival()).setAndReturn(newVal, t);
}
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, t, env);
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, v.getDefinedTarget(), env);
env.getEnv(GlobalEnv.class).GetVarList().set(v);
return v;
} else if(Static.anyDoubles(args[0])) {
@@ -762,7 +762,7 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
} catch (CloneNotSupportedException ex) {
Logger.getLogger(Math.class.getName()).log(Level.SEVERE, null, ex);
}
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, t, env);
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, v.getDefinedTarget(), env);
env.getEnv(GlobalEnv.class).GetVarList().set(v);
return oldVal;
} else if(Static.anyDoubles(args[0])) {
@@ -884,7 +884,7 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
if(v.ival() instanceof CMutablePrimitive) {
newVal = ((CMutablePrimitive) v.ival()).setAndReturn(newVal, t);
}
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, t, env);
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, v.getDefinedTarget(), env);
env.getEnv(GlobalEnv.class).GetVarList().set(v);
return v;
} else if(Static.anyDoubles(args[0])) {
@@ -1008,7 +1008,7 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
} catch (CloneNotSupportedException ex) {
Logger.getLogger(Math.class.getName()).log(Level.SEVERE, null, ex);
}
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, t, env);
v = new IVariable(v.getDefinedType(), v.getVariableName(), newVal, v.getDefinedTarget(), env);
env.getEnv(GlobalEnv.class).GetVarList().set(v);
return oldVal;
} else if(Static.anyDoubles(args[0])) {

0 comments on commit 52316a7

Please sign in to comment.