Skip to content

Commit 4ba773b

Browse files
committed
Fix runtime proc parameter typecheck
1 parent 5c7d40f commit 4ba773b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,9 @@ public Mixed exec(Target t, Environment env, Mixed... args) throws CancelCommand
13711371
}
13721372

13731373
// Assign value to variable.
1374+
// Overwrite variable if the type differs (can occur during proc parameter assignment in cloned outer scope).
13741375
IVariable var = list.get(varName);
1375-
if(var == null) {
1376+
if(var == null || (type != null && !type.equals(var.getDefinedType()))) {
13761377
var = new IVariable(type, varName, val, t);
13771378
list.set(var);
13781379
} else {

0 commit comments

Comments
 (0)