mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fix new ObsoleteAttribute
constructors
This commit is contained in:
parent
3e210999ce
commit
33fc0be429
1 changed files with 21 additions and 15 deletions
|
@ -3414,7 +3414,7 @@ void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstan
|
|||
|
||||
BfIRConstHolder* constHolder = typeInstance->mConstHolder;
|
||||
auto customAttribute = customAttributes->Get(mCompiler->mObsoleteAttributeTypeDef);
|
||||
if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty()) && (targetSrc != NULL))
|
||||
if ((customAttribute != NULL) && (targetSrc != NULL))
|
||||
{
|
||||
String err;
|
||||
if (fieldInstance != NULL)
|
||||
|
@ -3426,12 +3426,14 @@ void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstan
|
|||
|
||||
bool isError = false;
|
||||
|
||||
if (customAttribute->mCtorArgs.size() >= 1)
|
||||
{
|
||||
auto constant = constHolder->GetConstant(customAttribute->mCtorArgs[0]);
|
||||
if (constant->mTypeCode == BfTypeCode_Boolean)
|
||||
{
|
||||
isError = constant->mBool;
|
||||
}
|
||||
else if (customAttribute->mCtorArgs.size() >= 2)
|
||||
else if (constant->mTypeCode == BfTypeCode_StringId)
|
||||
{
|
||||
String* str = GetStringPoolString(customAttribute->mCtorArgs[0], constHolder);
|
||||
if (str != NULL)
|
||||
|
@ -3441,9 +3443,13 @@ void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstan
|
|||
err += "'";
|
||||
}
|
||||
|
||||
if (customAttribute->mCtorArgs.size() >= 2)
|
||||
{
|
||||
constant = constHolder->GetConstant(customAttribute->mCtorArgs[1]);
|
||||
isError = constant->mBool;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BfError* error = NULL;
|
||||
if (isError)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue