mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
fix(45907): don't use static member name to inherit JSDocs from instance members (#46274)
This commit is contained in:
@@ -599,10 +599,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
function findBaseOfDeclaration<T>(checker: TypeChecker, declaration: Declaration, cb: (symbol: Symbol) => T[] | undefined): T[] | undefined {
|
||||
if (hasStaticModifier(declaration)) return;
|
||||
|
||||
const classOrInterfaceDeclaration = declaration.parent?.kind === SyntaxKind.Constructor ? declaration.parent.parent : declaration.parent;
|
||||
if (!classOrInterfaceDeclaration) {
|
||||
return;
|
||||
}
|
||||
if (!classOrInterfaceDeclaration) return;
|
||||
|
||||
return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), superTypeNode => {
|
||||
const symbol = checker.getPropertyOfType(checker.getTypeAtLocation(superTypeNode), declaration.symbol.name);
|
||||
return symbol ? cb(symbol) : undefined;
|
||||
|
||||
Reference in New Issue
Block a user