Skip to content

Commit c87c501

Browse files
committed
Unwrap IVariable values in __unsafe_assign__()
1 parent b68fae0 commit c87c501

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/laytonsmith/core/functions/Compiler.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,8 +1359,15 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
13591359
val = args[1];
13601360
}
13611361

1362-
// Assign value to variable.
1362+
// Get variable list.
13631363
IVariableList list = env.getEnv(GlobalEnv.class).GetVarList();
1364+
1365+
// Unwrap assigned value from IVariable if an IVariable is passed.
1366+
if(val instanceof IVariable ivar) {
1367+
val = list.get(ivar.getVariableName(), ivar.getTarget(), env).ival();
1368+
}
1369+
1370+
// Assign value to variable.
13641371
IVariable var = list.get(varName);
13651372
if(var == null) {
13661373
var = new IVariable(type, varName, val, t);

0 commit comments

Comments
 (0)