Skip to content

Commit

Permalink
improve checking of compiler generated types
Browse files Browse the repository at this point in the history
  • Loading branch information
tonerdo committed Jun 30, 2018
1 parent 017b3d9 commit a1f18b4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/coverlet.core/Instrumentation/Instrumenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,9 @@ private void InstrumentModule()
using (var module = ModuleDefinition.ReadModule(stream, parameters))
{
var types = module.GetTypes();
foreach (var type in types)
foreach (TypeDefinition type in types)
{
TypeDefinition actualType = type;
if (type.FullName.Contains("/"))
actualType = types.FirstOrDefault(t => t.FullName == type.FullName.Split('/')[0]);

var actualType = type.DeclaringType ?? type;
if (!actualType.CustomAttributes.Any(IsExcludeAttribute)
&& !InstrumentationHelper.IsTypeExcluded(_module, actualType.FullName, _filters))
InstrumentType(type);
Expand Down

0 comments on commit a1f18b4

Please sign in to comment.