Microsoft/TypeScript
Function implementation name must be ... (2389) when abstract method is declared again later
Aperta
#61.783 aperta il 29 mag 2025
Domain: Error MessagesHelp WantedPossible Improvement
Metriche repository
- Star
- (108.860 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
🔎 Search Terms
duplicate abstract function declaration, abstract method, missing implementation, abstract method overload
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about abstract class
⏯ Playground Link
💻 Code
abstract class Foo {
abstract func1(): void;
func2(): string {
// ^? Function implementation name must be 'func1'.(2389)
return 'hi'
}
abstract func1(): void;
}
🙁 Actual behavior
TS error reported for func2, which is valid.
🙂 Expected behavior
TS error reported for func1, which has duplicated abstract declaration.
Additional information about the issue
No response