@@ -6607,11 +6607,12 @@ namespace ts {
6607
6607
* unique symbol type which we can then use as the name of the member. This allows users
6608
6608
* to define custom symbols that can be used in the members of an object type.
6609
6609
*
6610
+ * @param parent The containing symbol for the member.
6610
6611
* @param earlySymbols The early-bound symbols of the parent.
6611
6612
* @param lateSymbols The late-bound symbols of the parent.
6612
6613
* @param decl The member to bind.
6613
6614
*/
6614
- function lateBindMember(earlySymbols: SymbolTable | undefined, lateSymbols: SymbolTable, decl: LateBoundDeclaration) {
6615
+ function lateBindMember(parent: Symbol, earlySymbols: SymbolTable | undefined, lateSymbols: SymbolTable, decl: LateBoundDeclaration) {
6615
6616
Debug.assert(!!decl.symbol, "The member is expected to have a symbol.");
6616
6617
const links = getNodeLinks(decl);
6617
6618
if (!links.resolvedSymbol) {
@@ -6642,7 +6643,6 @@ namespace ts {
6642
6643
}
6643
6644
lateSymbol.nameType = type;
6644
6645
addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags);
6645
- const parent = getSymbolOfNode(decl.parent);
6646
6646
if (lateSymbol.parent) {
6647
6647
Debug.assert(lateSymbol.parent === parent, "Existing symbol parent should match new one");
6648
6648
}
@@ -6652,15 +6652,6 @@ namespace ts {
6652
6652
return links.resolvedSymbol = lateSymbol;
6653
6653
}
6654
6654
}
6655
- else {
6656
- const type = checkComputedPropertyName(decl.name);
6657
- if (isTypeUsableAsPropertyName(type)) {
6658
- const memberName = getPropertyNameFromType(type);
6659
- if (!lateSymbols.has(memberName)) {
6660
- lateSymbols.set(memberName, links.resolvedSymbol);
6661
- }
6662
- }
6663
- }
6664
6655
return links.resolvedSymbol;
6665
6656
}
6666
6657
@@ -6684,7 +6675,7 @@ namespace ts {
6684
6675
if (members) {
6685
6676
for (const member of members) {
6686
6677
if (isStatic === hasStaticModifier(member) && hasLateBindableName(member)) {
6687
- lateBindMember(earlySymbols, lateSymbols, member);
6678
+ lateBindMember(symbol, earlySymbols, lateSymbols, member);
6688
6679
}
6689
6680
}
6690
6681
}
@@ -6718,11 +6709,12 @@ namespace ts {
6718
6709
const links = getSymbolLinks(symbol);
6719
6710
if (!links.lateSymbol && some(symbol.declarations, hasLateBindableName)) {
6720
6711
// force late binding of members/exports. This will set the late-bound symbol
6712
+ const parent = getMergedSymbol(symbol.parent)!;
6721
6713
if (some(symbol.declarations, hasStaticModifier)) {
6722
- getExportsOfSymbol(symbol. parent! );
6714
+ getExportsOfSymbol(parent);
6723
6715
}
6724
6716
else {
6725
- getMembersOfSymbol(symbol. parent! );
6717
+ getMembersOfSymbol(parent);
6726
6718
}
6727
6719
}
6728
6720
return links.lateSymbol || (links.lateSymbol = symbol);
0 commit comments