@@ -4488,10 +4488,9 @@ namespace ts {
4488
4488
4489
4489
function getPropertiesOfType(type: Type): Symbol[] {
4490
4490
type = getApparentType(type);
4491
- if (type.flags & TypeFlags.UnionOrIntersection) {
4492
- return getPropertiesOfUnionOrIntersectionType(<UnionType>type);
4493
- }
4494
- return getPropertiesOfObjectType(type);
4491
+ return type.flags & TypeFlags.UnionOrIntersection ?
4492
+ getPropertiesOfUnionOrIntersectionType(<UnionType>type) :
4493
+ getPropertiesOfObjectType(type);
4495
4494
}
4496
4495
4497
4496
/**
@@ -4581,9 +4580,6 @@ namespace ts {
4581
4580
result.hasNonUniformType = hasNonUniformType;
4582
4581
result.isPartial = isPartial;
4583
4582
result.declarations = declarations;
4584
- if (declarations.length) {
4585
- result.valueDeclaration = declarations[0];
4586
- }
4587
4583
result.isReadonly = isReadonly;
4588
4584
result.type = containingType.flags & TypeFlags.Union ? getUnionType(propTypes) : getIntersectionType(propTypes);
4589
4585
return result;
@@ -5057,7 +5053,7 @@ namespace ts {
5057
5053
const declaration = getIndexDeclarationOfSymbol(symbol, kind);
5058
5054
if (declaration) {
5059
5055
return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType,
5060
- (getModifierFlags(declaration) & ModifierFlags.Readonly) !== 0, declaration);
5056
+ (getModifierFlags(declaration) & ModifierFlags.Readonly) !== 0, declaration);
5061
5057
}
5062
5058
return undefined;
5063
5059
}
@@ -5926,9 +5922,6 @@ namespace ts {
5926
5922
result.leftSpread = leftProp;
5927
5923
result.rightSpread = rightProp;
5928
5924
result.declarations = declarations;
5929
- if (declarations.length) {
5930
- result.valueDeclaration = declarations[0];
5931
- }
5932
5925
result.isReadonly = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp);
5933
5926
members[leftProp.name] = result;
5934
5927
}
@@ -15196,11 +15189,9 @@ namespace ts {
15196
15189
forEach(node.members, checkSourceElement);
15197
15190
if (produceDiagnostics) {
15198
15191
const type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
15199
- if (type.flags & TypeFlags.Object) {
15200
- checkIndexConstraints(type);
15201
- checkTypeForDuplicateIndexSignatures(node);
15202
- checkObjectTypeForDuplicateDeclarations(node);
15203
- }
15192
+ checkIndexConstraints(type);
15193
+ checkTypeForDuplicateIndexSignatures(node);
15194
+ checkObjectTypeForDuplicateDeclarations(node);
15204
15195
}
15205
15196
}
15206
15197
@@ -17259,7 +17250,7 @@ namespace ts {
17259
17250
// perform property check if property or indexer is declared in 'type'
17260
17251
// this allows to rule out cases when both property and indexer are inherited from the base class
17261
17252
let errorNode: Node;
17262
- if (prop.valueDeclaration.name.kind === SyntaxKind.ComputedPropertyName || prop.parent === containingType.symbol) {
17253
+ if (prop.valueDeclaration.name.kind === SyntaxKind.ComputedPropertyName || prop.parent === containingType.symbol) {
17263
17254
errorNode = prop.valueDeclaration;
17264
17255
}
17265
17256
else if (indexDeclaration) {
@@ -20538,7 +20529,7 @@ namespace ts {
20538
20529
continue;
20539
20530
}
20540
20531
const name = prop.name;
20541
- if (name && name .kind === SyntaxKind.ComputedPropertyName) {
20532
+ if (name.kind === SyntaxKind.ComputedPropertyName) {
20542
20533
// If the name is not a ComputedPropertyName, the grammar checking will skip it
20543
20534
checkGrammarComputedPropertyName(<ComputedPropertyName>name);
20544
20535
}
0 commit comments