fix(47561): use parameter name from enclosing declaration (#47609)

This commit is contained in:
Oleksandr T
2022-01-26 14:00:14 +02:00
committed by GitHub
parent d56d62185f
commit 3206df8e6d
5 changed files with 141 additions and 1 deletions

View File

@@ -6397,7 +6397,8 @@ namespace ts {
includePrivateSymbol?.(sym);
}
if (isIdentifier(node)) {
const name = sym.flags & SymbolFlags.TypeParameter ? typeParameterToName(getDeclaredTypeOfSymbol(sym), context) : factory.cloneNode(node);
const type = getDeclaredTypeOfSymbol(sym);
const name = sym.flags & SymbolFlags.TypeParameter && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : factory.cloneNode(node);
name.symbol = sym; // for quickinfo, which uses identifier symbol information
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), EmitFlags.NoAsciiEscaping) };
}