@@ -8202,7 +8202,7 @@ namespace ts {
8202
8202
if (isParameter(declaration)) {
8203
8203
const func = <FunctionLikeDeclaration>declaration.parent;
8204
8204
// For a parameter of a set accessor, use the type of the get accessor if one is present
8205
- if (func.kind === SyntaxKind.SetAccessor && !hasNonBindableDynamicName (func)) {
8205
+ if (func.kind === SyntaxKind.SetAccessor && hasBindableName (func)) {
8206
8206
const getter = getDeclarationOfKind<AccessorDeclaration>(getSymbolOfNode(declaration.parent), SyntaxKind.GetAccessor);
8207
8207
if (getter) {
8208
8208
const getterSignature = getSignatureFromDeclaration(getter);
@@ -9877,10 +9877,10 @@ namespace ts {
9877
9877
}
9878
9878
9879
9879
/**
9880
- * Indicates whether a declaration has a dynamic name that cannot be late-bound.
9880
+ * Indicates whether a declaration has an early-bound name or a dynamic name that can be late-bound.
9881
9881
*/
9882
- function hasNonBindableDynamicName (node: Declaration) {
9883
- return hasDynamicName(node) && ! hasLateBindableName(node);
9882
+ function hasBindableName (node: Declaration) {
9883
+ return ! hasDynamicName(node) || hasLateBindableName(node);
9884
9884
}
9885
9885
9886
9886
/**
@@ -11827,7 +11827,7 @@ namespace ts {
11827
11827
11828
11828
// If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation
11829
11829
if ((declaration.kind === SyntaxKind.GetAccessor || declaration.kind === SyntaxKind.SetAccessor) &&
11830
- !hasNonBindableDynamicName (declaration) &&
11830
+ hasBindableName (declaration) &&
11831
11831
(!hasThisParameter || !thisParameter)) {
11832
11832
const otherKind = declaration.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor;
11833
11833
const other = getDeclarationOfKind<AccessorDeclaration>(getSymbolOfNode(declaration), otherKind);
@@ -12051,7 +12051,7 @@ namespace ts {
12051
12051
if (typeNode) {
12052
12052
return getTypeFromTypeNode(typeNode);
12053
12053
}
12054
- if (declaration.kind === SyntaxKind.GetAccessor && !hasNonBindableDynamicName (declaration)) {
12054
+ if (declaration.kind === SyntaxKind.GetAccessor && hasBindableName (declaration)) {
12055
12055
const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
12056
12056
if (jsDocType) {
12057
12057
return jsDocType;
@@ -24414,7 +24414,7 @@ namespace ts {
24414
24414
const objectLiteral = <ObjectLiteralExpression>element.parent;
24415
24415
const type = getApparentTypeOfContextualType(objectLiteral, contextFlags);
24416
24416
if (type) {
24417
- if (!hasNonBindableDynamicName (element)) {
24417
+ if (hasBindableName (element)) {
24418
24418
// For a (non-symbol) computed property, there is no reason to look up the name
24419
24419
// in the type. It will just be "__computed", which does not appear in any
24420
24420
// SymbolTable.
@@ -32305,7 +32305,7 @@ namespace ts {
32305
32305
if (isPrivateIdentifier(node.name)) {
32306
32306
error(node.name, Diagnostics.An_accessor_cannot_be_named_with_a_private_identifier);
32307
32307
}
32308
- if (!hasNonBindableDynamicName (node)) {
32308
+ if (hasBindableName (node)) {
32309
32309
// TypeScript 1.0 spec (April 2014): 8.4.3
32310
32310
// Accessors for the same member name must specify the same accessibility.
32311
32311
const otherKind = node.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor;
@@ -33631,7 +33631,7 @@ namespace ts {
33631
33631
checkComputedPropertyName(node.name);
33632
33632
}
33633
33633
33634
- if (!hasNonBindableDynamicName (node)) {
33634
+ if (hasBindableName (node)) {
33635
33635
// first we want to check the local symbol that contain this declaration
33636
33636
// - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol
33637
33637
// - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode
@@ -35634,7 +35634,7 @@ namespace ts {
35634
35634
// Only process instance properties with computed names here.
35635
35635
// Static properties cannot be in conflict with indexers,
35636
35636
// and properties with literal names were already checked.
35637
- if (!hasSyntacticModifier(member, ModifierFlags.Static) && hasNonBindableDynamicName (member)) {
35637
+ if (!hasSyntacticModifier(member, ModifierFlags.Static) && !hasBindableName (member)) {
35638
35638
const symbol = getSymbolOfNode(member);
35639
35639
const propType = getTypeOfSymbol(symbol);
35640
35640
checkIndexConstraintForProperty(symbol, propType, type, declaredStringIndexer, stringIndexType, IndexKind.String);
0 commit comments