Open stakx opened 6 years ago
should this issue also cover other attributes, that target obsolete member?
[Obsolete]
class A
{
}
class SomeAttribute : Attribute
{
public SomeAttribute(string _)
{
}
}
class B
{
[Obsolete]
[Some(nameof(A))]
public string Prop { get; }
[field: Obsolete]
[field: Some(nameof(A))]
public string Prop2 { get; }
}
Version Used: Visual Studio 15.4.0
Steps to Reproduce:
Expected Behavior: No compiler warnings are emitted about
Old
being obsolete. (The two methods that referenceOld
are themselves marked[Obsolete]
. The[Obsolete]
attributes that themselves refer toOld
don't trigger warnings, either.)Actual Behavior: One warning
CS0612: 'Old' is obsolete
is emitted for the line marked with(*)
above. Note that the warning is only triggered for the[Obsolete]
attribute being placed on a method. When placed on a class, no warning is emitted. That doesn't seem right to me.(This isn't specific to Visual Studio IntelliSense. The warning is also emitted when compiling on the command line.)