Deprecated API element remover does the wrong thing in case of deprecated base class
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 267
- Avg merge
- 1d 25m
- Merged PRs (30d)
- 14
Description
## :bug: Bug Report
### Affected Languages
- [ ] `TypeScript` or `Javascript`
- [ ] `Python`
- [ ] `Java`
- [x] .NET (`C#`, `F#`, ...)
- [ ] `Go`
### What is the problem?
The deprecated API element remover generates incorrect code based on the following sources:
```ts
interface ISomeInterface {
someMethod(): void;
}
/** @deprecated */
class SomeBaseClass implements ISomeInterface {
public someMethod() {
console.log('some method');
}
}
class Subclass extends SomeBaseclass {
}
```
### What happens?
`SomeBaseClass` gets completely removed, but the fact that `Subclass implements ISomeInterface` does get propagated (as it should).
End result is that `Subclass` does not have an implementation for `someMethod`, and so in fact DOES NOT end up implementing `ISomeInterface`.
This definitely fails in C#... might affect other languages too. In C# the class ends up like this:
```cs
class Subclass : DeputyBase, ISomeInterface {
//
}
```
And we then get an error that the implementation for `SomeMethod` is missing.
Contributor guide
Research direction
Start by reproducing the deprecated base-class example through the deprecated API element remover and inspect how it transforms the generated C# hierarchy. Verify that removing SomeBaseClass preserves the inherited someMethod implementation or otherwise keeps Subclass valid as an ISomeInterface implementation; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, typescript
- Domain
- backend-api-design, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100