mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Merge pull request #2177 from Fusioon/Fix-#2176
Fix static readonly warning in class body
This commit is contained in:
commit
d778187e34
1 changed files with 6 additions and 3 deletions
|
@ -20496,9 +20496,12 @@ bool BfExprEvaluator::CheckModifyResult(BfTypedValue& typedVal, BfAstNode* refNo
|
||||||
|
|
||||||
if ((mResultFieldInstance != NULL) && (mResultFieldInstance->GetFieldDef()->mIsReadOnly) && (!canModify))
|
if ((mResultFieldInstance != NULL) && (mResultFieldInstance->GetFieldDef()->mIsReadOnly) && (!canModify))
|
||||||
{
|
{
|
||||||
auto error = _Fail(StrFormat("Cannot %s static readonly field '%s.%s' within method '%s'", modifyType,
|
if (mModule->mCurMethodInstance != NULL)
|
||||||
mModule->TypeToString(mResultFieldInstance->mOwner).c_str(), mResultFieldInstance->GetFieldDef()->mName.c_str(),
|
{
|
||||||
mModule->MethodToString(mModule->mCurMethodInstance).c_str()), refNode);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue