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

Properly skip comptime attributes for non-matching extensions

This commit is contained in:
Brian Fiete 2023-02-24 07:00:02 -05:00
parent 4373381088
commit 63b053d7d7

View file

@ -2406,6 +2406,12 @@ void BfModule::HandleCEAttributes(CeEmitContext* ceEmitContext, BfTypeInstance*
{ {
for (auto& customAttribute : customAttributes->mAttributes) for (auto& customAttribute : customAttributes->mAttributes)
{ {
if ((customAttribute.mDeclaringType->IsExtension()) && (typeInstance->IsGenericTypeInstance()))
{
if (!typeInstance->IsTypeMemberIncluded(customAttribute.mDeclaringType, typeInstance->mTypeDef, this))
continue;
}
auto attrType = customAttribute.mType; auto attrType = customAttribute.mType;
BfMethodInstance* methodInstance = NULL; BfMethodInstance* methodInstance = NULL;