1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed compond assignment operator overloads

This commit is contained in:
Brian Fiete 2020-02-02 05:30:19 -08:00
parent 0c7597fe60
commit ca64ea1f28
3 changed files with 66 additions and 14 deletions

View file

@ -522,12 +522,22 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
declError = "'public'";
methodDef->mProtection = BfProtection_Public; // Fix it
}
if (!methodDef->mIsStatic)
if (operatorDecl->mAssignOp != BfAssignmentOp_None)
{
if (!declError.empty())
declError += " and ";
declError += "'static'";
methodDef->mIsStatic = true; // Fix it
if (methodDef->mIsStatic)
{
Fail("Assignment operator must not be declared 'static'", operatorDecl->mStaticSpecifier);
}
}
else
{
if (!methodDef->mIsStatic)
{
if (!declError.empty())
declError += " and ";
declError += "'static'";
methodDef->mIsStatic = true; // Fix it
}
}
if (!declError.empty())
{