-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
Description
Using the following code:
using System;
using System.Diagnostics.CodeAnalysis;
public class C
{
[RequiresAssemblyFiles(Message = "message")]
public int M1() => 0;
public event EventHandler E1
{
add
{
var a = M1();
}
remove { }
}
}Should lead to a warning in the add event property, which later on should be able to be suppressed by adding an attribute to the event, like:
using System;
using System.Diagnostics.CodeAnalysis;
public class C
{
[RequiresAssemblyFiles(Message = "message")]
public int M1() => 0;
[RequiresAssemblyFiles()]
public event EventHandler E1
{
add
{
var a = M1();
}
remove { }
}
}The RequiresAssemblyFiles will continue to warn in the var a = M1(); assign operation, contrary to the use of UnconditionalSuppressMessage which will silence the warning
Reactions are currently unavailable