Skip to content

Commit

Permalink
Filter attributes in both directions
Browse files Browse the repository at this point in the history
- otherwise, `ValidateApiCompatForSrc` target succeeds while `RunMatchingRefApiCompat` fails in some cases
  - or visa versa
  • Loading branch information
dougbu committed Mar 31, 2020
1 parent 1929770 commit 509dcba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.Cci.Extensions/Mappings/AttributesMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ protected virtual IEnumerable<ICustomAttribute> GetAttributes(T element)
{
IReference reference = element as IReference;
if (reference != null)
return reference.Attributes;
return reference.Attributes.Where(Filter.Include);

IEnumerable<ICustomAttribute> attributes = element as IEnumerable<ICustomAttribute>;
if (attributes != null)
return attributes;
return attributes.Where(Filter.Include);

return null;
}
Expand Down

0 comments on commit 509dcba

Please sign in to comment.