dotnet / dotnet/csharplang

[Proposal]: Show obsolete errors from overrides

Open
#8,938 0 comments 0 reactions 1 assignee Claimed by @333fred View on GitHub
Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

# Show obsolete errors from overrides

* Specification: None yet.
* Discussion: https://github.com/dotnet/csharplang/discussions/8937

## Summary
[summary]: #summary

Today, when an override of a virtual member adds `Obsolete`, we do not warn that the method is obsoleted when the derived type is statically known as the receiver. For example:

```cs
abstract class Base
{
public abstract void M();
}

class Derived : Base
{
[Obsolete]
public override void M() => throw null;

public void M2()
{
M(); // No warning
}
}
```

This is something that we can detect at warn about.

## Design meetings

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.