Version Used: current
Steps to Reproduce:
public class C {
[Obsolete]
public C() {}
public void M<T>() where T : new() => M<C>();
}
Expected Behavior: warning: C() is obsolete
Actual Behavior: no warnings
EDIT: As @sharwell pointed out, warnings for obsolete members are not reported when the use is itself enclosed in a construct which is marked obsolete. so the following should be compiled without any warnings.
class C<T> where T : new() {
[Obsolete]
public C() => new C<C<T>>();
}
Version Used: current
Steps to Reproduce:
Expected Behavior: warning: C() is obsolete
Actual Behavior: no warnings
EDIT: As @sharwell pointed out, warnings for obsolete members are not reported when the use is itself enclosed in a construct which is marked obsolete. so the following should be compiled without any warnings.