From d27707cb6b867c46139175d33158528e65765903 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 29 Nov 2019 09:23:08 -0800 Subject: [PATCH] Fixed type lookup for attributes on fields when we have extensions --- IDEHelper/Compiler/BfModuleTypeUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 0c34611f..661f0c9f 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -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 prevTypeState(mContext->mCurTypeState, &typeState); + fieldInstance->mCustomAttributes = GetCustomAttributes(fieldDef->mFieldDeclaration->mAttributes, fieldDef->mIsStatic ? BfAttributeTargets_StaticField : BfAttributeTargets_Field); for (auto customAttr : fieldInstance->mCustomAttributes->mAttributes)