mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Allow default param before params param
This commit is contained in:
parent
bd6e21073e
commit
a9d9776bcb
2 changed files with 2 additions and 2 deletions
|
@ -667,7 +667,7 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
|
||||||
|
|
||||||
if (paramDef->mParamDeclaration->mInitializer != NULL)
|
if (paramDef->mParamDeclaration->mInitializer != NULL)
|
||||||
hasDefault = true;
|
hasDefault = true;
|
||||||
else if (hasDefault)
|
else if ((hasDefault) && (paramDef->mParamKind != BfParamKind_Params))
|
||||||
{
|
{
|
||||||
if (!didDefaultsError)
|
if (!didDefaultsError)
|
||||||
Fail("Optional parameters must appear after all required parameters", methodDef->mParams[paramIdx - 1]->mParamDeclaration);
|
Fail("Optional parameters must appear after all required parameters", methodDef->mParams[paramIdx - 1]->mParamDeclaration);
|
||||||
|
|
|
@ -5830,7 +5830,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
|
||||||
|
|
||||||
if (!isDirectPass)
|
if (!isDirectPass)
|
||||||
{
|
{
|
||||||
int numElements = (int)argValues.size() - argIdx;
|
int numElements = BF_MAX((int)argValues.size() - argIdx, 0);
|
||||||
if (methodDef->mMethodType == BfMethodType_Extension)
|
if (methodDef->mMethodType == BfMethodType_Extension)
|
||||||
numElements++;
|
numElements++;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue