Skip to content

Commit

Permalink
Change closure return type instanceof check to cached variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter12345 committed Dec 27, 2024
1 parent 1c47d1a commit f828f47
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ protected void execute(Mixed... values) throws ConfigRuntimeException, ProgramFl
// Check the return type of the closure to see if it matches the defined type
// Normal execution.
Mixed ret = ex.getReturn();
if(!InstanceofUtil.isInstanceof(ret, returnType, environment)) {
if(!InstanceofUtil.isInstanceof(ret.typeof(), returnType, environment)) {
throw new CRECastException("Expected closure to return a value of type " + returnType.val()
+ " but a value of type " + ret.typeof() + " was returned instead", ret.getTarget());
}
Expand Down

0 comments on commit f828f47

Please sign in to comment.