give error instead of warning for zscript 4.12+ on return count mismatch

This commit is contained in:
Ricardo Luís Vaz Silva 2023-10-15 12:23:13 -03:00 committed by Christoph Oelckers
parent d699ba248e
commit 1957c15a41
1 changed files with 1 additions and 1 deletions

View File

@ -11332,7 +11332,7 @@ FxExpression *FxReturnStatement::Resolve(FCompileContext &ctx)
}
else if (protoRetCount > retCount)
{ // also warn when returning less values then the return count
mismatchSeverity = MSG_WARNING;
mismatchSeverity = ctx.Version >= MakeVersion(4, 12) ? MSG_ERROR : MSG_WARNING;
}
}