mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 11:24:49 -05:00
Rename type parameters when they are shadowed. (#61342)
This commit is contained in:
committed by
GitHub
parent
47442d958c
commit
c85e626d8e
@@ -1122,15 +1122,16 @@ export function createSyntacticTypeNodeBuilder(
|
||||
);
|
||||
}
|
||||
function reuseTypeParameters(typeParameters: NodeArray<TypeParameterDeclaration> | undefined, context: SyntacticTypeNodeBuilderContext) {
|
||||
return typeParameters?.map(tp =>
|
||||
factory.updateTypeParameterDeclaration(
|
||||
return typeParameters?.map(tp => {
|
||||
const { node: tpName } = resolver.trackExistingEntityName(context, tp.name);
|
||||
return factory.updateTypeParameterDeclaration(
|
||||
tp,
|
||||
tp.modifiers?.map(m => reuseNode(context, m)),
|
||||
reuseNode(context, tp.name),
|
||||
tpName,
|
||||
serializeExistingTypeNodeWithFallback(tp.constraint, context),
|
||||
serializeExistingTypeNodeWithFallback(tp.default, context),
|
||||
)
|
||||
);
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function typeFromObjectLiteralMethod(method: MethodDeclaration, name: PropertyName, context: SyntacticTypeNodeBuilderContext, isConstContext: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user