mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed params/varargs in function/delegate typerefs
This commit is contained in:
parent
a730e782f5
commit
9c9ca4d259
2 changed files with 28 additions and 4 deletions
|
@ -656,7 +656,7 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
|
|||
if (paramIdx == (int)methodDeclaration->mParams.size() - 1)
|
||||
paramDef->mParamKind = BfParamKind_VarArgs;
|
||||
else
|
||||
Fail("Varargs specifier must be the last parameter", methodDef->mParams[paramIdx - 1]->mParamDeclaration);
|
||||
Fail("Varargs specifier must be the last parameter", paramDecl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8730,7 +8730,7 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
|
|||
directTypeRef->Init(paramType);
|
||||
|
||||
BfParameterDef* paramDef = new BfParameterDef();
|
||||
|
||||
paramDef->mParamKind = unspecializedParamDef->mParamKind;
|
||||
paramDef->mTypeRef = directTypeRef;
|
||||
paramDef->mName = unspecializedParamDef->mName;
|
||||
methodDef->mParams.push_back(paramDef);
|
||||
|
@ -11905,6 +11905,30 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
|||
if ((paramIdx == 0) && (functionThisType != NULL))
|
||||
paramDef->mParamKind = BfParamKind_ExplicitThis;
|
||||
methodDef->mParams.push_back(paramDef);
|
||||
if ((param->mModToken != NULL) && (param->mModToken->mToken == BfToken_Params))
|
||||
{
|
||||
if (paramIdx == (int)paramTypes.size() - 1)
|
||||
paramDef->mParamKind = BfParamKind_Params;
|
||||
else
|
||||
{
|
||||
failed = true;
|
||||
Fail("Params parameter must be the last parameter", param);
|
||||
}
|
||||
}
|
||||
|
||||
if (auto dotTypeRef = BfNodeDynCast<BfDotTypeReference>(paramDef->mTypeRef))
|
||||
{
|
||||
if (dotTypeRef->mDotToken->mToken == BfToken_DotDotDot)
|
||||
{
|
||||
if (paramIdx == (int)paramTypes.size() - 1)
|
||||
paramDef->mParamKind = BfParamKind_VarArgs;
|
||||
else
|
||||
{
|
||||
failed = true;
|
||||
Fail("Varargs specifier must be the last parameter", param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delegateInfo->mParams.Add(paramType);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue