Skip to content

Commit 2c92629

Browse files
committed
Suppress CS0436 in codegen template.
1 parent 7bd81aa commit 2c92629

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/BenchmarkDotNet/Templates/BenchmarkProgram.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ $ExtraDefines$
77
#if !NET7_0_OR_GREATER
88
namespace System.Diagnostics.CodeAnalysis
99
{
10-
/// <summary>
11-
/// Specifies that this constructor sets all required members for the current type,
12-
/// and callers do not need to set any required members themselves.
13-
/// </summary>
10+
// User code could poly-fill this type and leave it public, so we disable the warning just in case.
11+
#pragma warning disable CS0436 // Type conflicts with imported type
1412
[global::System.AttributeUsage(global::System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
1513
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
1614
internal sealed class SetsRequiredMembersAttribute : global::System.Attribute
1715
{
1816
}
17+
#pragma warning restore CS0436 // Type conflicts with imported type
1918
}
2019
#endif
2120

22-
// the namespace name must be in sync with WindowsDisassembler.BuildArguments
21+
// the namespace name must be in sync with DisassemblyDiagnoser.BuildClrMdArgs
2322
namespace BenchmarkDotNet.Autogenerated
2423
{
2524
public class UniqueProgramName // we need different name than typical "Program" to avoid problems with referencing "Program" types from benchmarked code, #691

0 commit comments

Comments
 (0)