1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Merge pull request #2177 from Fusioon/Fix-#2176

Fix static readonly warning in class body
This commit is contained in:
Brian Fiete 2025-03-07 12:03:02 -08:00 committed by GitHub
commit d778187e34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20495,10 +20495,13 @@ bool BfExprEvaluator::CheckModifyResult(BfTypedValue& typedVal, BfAstNode* refNo
}
if ((mResultFieldInstance != NULL) && (mResultFieldInstance->GetFieldDef()->mIsReadOnly) && (!canModify))
{
if (mModule->mCurMethodInstance != NULL)
{
auto error = _Fail(StrFormat("Cannot %s static readonly field '%s.%s' within method '%s'", modifyType,
mModule->TypeToString(mResultFieldInstance->mOwner).c_str(), mResultFieldInstance->GetFieldDef()->mName.c_str(),
mModule->MethodToString(mModule->mCurMethodInstance).c_str()), refNode);
}
return false;
}