Skip to content

Commit

Permalink
Respect ICciFilter when generating fields in value types
Browse files Browse the repository at this point in the history
- #2031 aka #2033 aka #4488 problem (6)
- remove `IsVisibleOutsideAssembly()` use; was at best redundant
  • Loading branch information
dougbu committed Mar 15, 2020
1 parent 8af3481 commit 131e0cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.Cci.Extensions/Writers/CSharp/CSharpWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ public override void Visit(ITypeDefinition parentType, IEnumerable<IFieldDefinit

// Note: By "private", we mean not visible outside the assembly.

// For more details see issue https://github.com/dotnet/corefx/issues/6185
// For more details see issue https://github.com/dotnet/corefx/issues/6185
// this blog is helpful as well http://blog.paranoidcoding.com/2016/02/15/are-private-members-api-surface.html

List<IFieldDefinition> newFields = new List<IFieldDefinition>();
var includedVisibleFields = fields.Where(f => f.IsVisibleOutsideAssembly()).Where(_cciFilter.Include);
var includedVisibleFields = fields.Where(f => _cciFilter.Include(f));
includedVisibleFields = includedVisibleFields.OrderBy(GetMemberKey, StringComparer.OrdinalIgnoreCase);

var excludedFields = fields.Except(includedVisibleFields).Where(f => !f.IsStatic);
Expand Down

0 comments on commit 131e0cf

Please sign in to comment.