mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
fix(55494): Invalid declaration with computed property using imported symbol (#55529)
This commit is contained in:
@@ -100,6 +100,7 @@ import {
|
||||
isBindingPattern,
|
||||
isClassDeclaration,
|
||||
isClassElement,
|
||||
isComputedPropertyName,
|
||||
isDeclaration,
|
||||
isElementAccessExpression,
|
||||
isEntityName,
|
||||
@@ -701,6 +702,9 @@ export function transformDeclarations(context: TransformationContext) {
|
||||
if (elem.kind === SyntaxKind.OmittedExpression) {
|
||||
return elem;
|
||||
}
|
||||
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
||||
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
||||
}
|
||||
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
||||
// Unnecessary property renaming is forbidden in types, so remove renaming
|
||||
return factory.updateBindingElement(
|
||||
|
||||
Reference in New Issue
Block a user