warn when fewer returns than expected are given for a function
This commit is contained in:
parent
e2a9208c56
commit
d699ba248e
3 changed files with 10 additions and 4 deletions
|
|
@ -11330,6 +11330,10 @@ FxExpression *FxReturnStatement::Resolve(FCompileContext &ctx)
|
|||
{
|
||||
mismatchSeverity = MSG_ERROR;
|
||||
}
|
||||
else if (protoRetCount > retCount)
|
||||
{ // also warn when returning less values then the return count
|
||||
mismatchSeverity = MSG_WARNING;
|
||||
}
|
||||
}
|
||||
|
||||
if (mismatchSeverity != -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue