mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +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;
|
BfIRConstHolder* constHolder = typeInstance->mConstHolder;
|
||||||
auto customAttribute = customAttributes->Get(mCompiler->mObsoleteAttributeTypeDef);
|
auto customAttribute = customAttributes->Get(mCompiler->mObsoleteAttributeTypeDef);
|
||||||
if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty()) && (targetSrc != NULL))
|
if ((customAttribute != NULL) && (targetSrc != NULL))
|
||||||
{
|
{
|
||||||
String err;
|
String err;
|
||||||
if (fieldInstance != NULL)
|
if (fieldInstance != NULL)
|
||||||
|
@ -3426,12 +3426,14 @@ void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstan
|
||||||
|
|
||||||
bool isError = false;
|
bool isError = false;
|
||||||
|
|
||||||
|
if (customAttribute->mCtorArgs.size() >= 1)
|
||||||
|
{
|
||||||
auto constant = constHolder->GetConstant(customAttribute->mCtorArgs[0]);
|
auto constant = constHolder->GetConstant(customAttribute->mCtorArgs[0]);
|
||||||
if (constant->mTypeCode == BfTypeCode_Boolean)
|
if (constant->mTypeCode == BfTypeCode_Boolean)
|
||||||
{
|
{
|
||||||
isError = constant->mBool;
|
isError = constant->mBool;
|
||||||
}
|
}
|
||||||
else if (customAttribute->mCtorArgs.size() >= 2)
|
else if (constant->mTypeCode == BfTypeCode_StringId)
|
||||||
{
|
{
|
||||||
String* str = GetStringPoolString(customAttribute->mCtorArgs[0], constHolder);
|
String* str = GetStringPoolString(customAttribute->mCtorArgs[0], constHolder);
|
||||||
if (str != NULL)
|
if (str != NULL)
|
||||||
|
@ -3441,9 +3443,13 @@ void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstan
|
||||||
err += "'";
|
err += "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (customAttribute->mCtorArgs.size() >= 2)
|
||||||
|
{
|
||||||
constant = constHolder->GetConstant(customAttribute->mCtorArgs[1]);
|
constant = constHolder->GetConstant(customAttribute->mCtorArgs[1]);
|
||||||
isError = constant->mBool;
|
isError = constant->mBool;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BfError* error = NULL;
|
BfError* error = NULL;
|
||||||
if (isError)
|
if (isError)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue