[F#]ExcludeFromCodeCoverage Attributes on nested types may not be honoured
In F# code like this (which itself is an attempt to work around issue #76)
namespace MyNamespace
module MyModule =
[<System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>]
type internal AlgebraicType =
| First
| Second
| Third
the attribute has no effect, as the type is nested inside a module (= static class ).
There is a work-around in the form of moving the annotated type outside the module. This lets the attribute have effect at the cost of polluting the containing namespace with the intended-to-be-module-local type.
Having the same issue with private nested classes in C#. For example we have some DebuggerTypeProxy related classes that we annotate with ExcludeFromCodeCoverage, but it is not actually excluded. Moving to a non-nested class (and polluting the namespace) does correct the issue.
Having the same issue with private nested classes in C#. For example we have some DebuggerTypeProxy related classes that we annotate with ExcludeFromCodeCoverage, but it is not actually excluded. Moving to a non-nested class (and polluting the namespace) does correct the issue.
This should be fixed on master dup of https://github.com/tonerdo/coverlet/issues/724 Can you try with nightly https://github.com/tonerdo/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md?
The issue might be out-dated because new releases are available.
Please reopen the issue if the bug still exists and can be reproduced with latest preview from coverlet nightly build.