| 12541 | } |
| 12542 | |
| 12543 | void BfModule::ValidateCustomAttributes(BfCustomAttributes* customAttributes, BfAttributeTargets attrTarget, bool force) |
| 12544 | { |
| 12545 | if (attrTarget == BfAttributeTargets_SkipValidate) |
| 12546 | return; |
| 12547 | |
| 12548 | for (auto& customAttribute : customAttributes->mAttributes) |
| 12549 | { |
| 12550 | if (!customAttribute.mAwaitingValidation) |
| 12551 | continue; |
| 12552 | |
| 12553 | if ((customAttribute.mType->mAttributeData->mAttributeTargets & attrTarget) == 0) |
| 12554 | { |
| 12555 | if ((customAttribute.mIsMultiUse) && (!force)) |
| 12556 | continue; |
| 12557 | |
| 12558 | Fail(StrFormat("Attribute '%s' is not valid on this declaration type. It is only valid on %s.", |
| 12559 | customAttribute.GetRefNode()->ToString().c_str(), GetAttributesTargetListString(customAttribute.mType->mAttributeData->mAttributeTargets).c_str()), customAttribute.mRef->mAttributeTypeRef); // CS0592 |
| 12560 | } |
| 12561 | |
| 12562 | customAttribute.mAwaitingValidation = false; |
| 12563 | } |
| 12564 | } |
| 12565 | |
| 12566 | void BfModule::GetCustomAttributes(BfCustomAttributes* customAttributes, BfAttributeDirective* attributesDirective, BfAttributeTargets attrTarget, BfGetCustomAttributesFlags flags, BfCaptureInfo* captureInfo) |
| 12567 | { |
no test coverage detected