-
-
Notifications
You must be signed in to change notification settings - Fork 739
Closed
Closed
Copy link
Description
Search terms
overload, interface
Expected Behavior
Overloaded functions in concrete class implementations should inherit the correct documentation from the interface
Actual Behavior
It seems as if only the first overload in the interface gets inherited to all overloads in the concrete implementation
Steps to reproduce the bug
(note you don't need the abstract class, it occurs with just the interface and concrete)
Here is some minimal code:
interface Test {
/**
* Provide a string and I will give you a boolean
*
* @example
* concrete.myFunc('str'); // false
*/
myFunc (a: string) : boolean;
/**
* Pass me a number and I will give you a number
*
* @example
* concrete.myFunc(5); // 1
*/
myFunc (a: number) : number;
/**
* Pass me a string and I will give you a number
*
* @example
* concrete.myFunc('str'); // 1
*/
anotherFunc (a: string) : number;
/**
* Pass me a number and I will give you a boolean
*
* @example
* concrete.myFunc(5); // false
*/
anotherFunc (a: number) : boolean;
}
class ConcreteTest implements Test {
myFunc (a: string) : boolean;
myFunc (a: number) : number;
myFunc (a: string | number): number | boolean {
if (typeof a === 'string') {
return false;
}
return 1;
}
anotherFunc (a: string) : number;
anotherFunc (a: number) : boolean;
anotherFunc (a: string | number): number | boolean {
if (typeof a === 'string') {
return 1;
}
return false;
}
}
Here is the result - in the interface, the docs are correct:
But in the concrete implementation, the docs are incorrect:
Environment
- Typedoc version: 0.26.10
- TypeScript version: 5.6.3
- Node.js version: 20.13.1
- OS: Windows
Metadata
Metadata
Assignees
Labels
No labels