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

Fixed type lookup for attributes on fields when we have extensions

This commit is contained in:
Brian Fiete 2019-11-29 09:23:08 -08:00
parent a3f1a33c39
commit d27707cb6b

View file

@ -2475,6 +2475,10 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
BF_ASSERT(fieldInstance->mCustomAttributes == NULL);
if ((fieldDef != NULL) && (fieldDef->mFieldDeclaration != NULL) && (fieldDef->mFieldDeclaration->mAttributes != NULL))
{
BfTypeState typeState;
typeState.mCurTypeDef = fieldDef->mDeclaringType;
SetAndRestoreValue<BfTypeState*> prevTypeState(mContext->mCurTypeState, &typeState);
fieldInstance->mCustomAttributes = GetCustomAttributes(fieldDef->mFieldDeclaration->mAttributes, fieldDef->mIsStatic ? BfAttributeTargets_StaticField : BfAttributeTargets_Field);
for (auto customAttr : fieldInstance->mCustomAttributes->mAttributes)