@@ -2670,9 +2670,10 @@ module ts {
26702670 let constructSignatures = type.declaredConstructSignatures;
26712671 let stringIndexType = type.declaredStringIndexType;
26722672 let numberIndexType = type.declaredNumberIndexType;
2673- if (getBaseTypes(type).length) {
2673+ let baseTypes = getBaseTypes(type);
2674+ if (baseTypes.length) {
26742675 members = createSymbolTable(type.declaredProperties);
2675- forEach(getBaseTypes(type) , baseType => {
2676+ forEach(baseTypes , baseType => {
26762677 addInheritedMembers(members, getPropertiesOfObjectType(baseType));
26772678 callSignatures = concatenate(callSignatures, getSignaturesOfType(baseType, SignatureKind.Call));
26782679 constructSignatures = concatenate(constructSignatures, getSignaturesOfType(baseType, SignatureKind.Construct));
@@ -2720,9 +2721,10 @@ module ts {
27202721 sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals);
27212722 }
27222723
2723- function getDefaultConstructSignatures(classType: InterfaceType): Signature[] {
2724- if (getBaseTypes(classType).length) {
2725- let baseType = getBaseTypes(classType)[0];
2724+ function getDefaultConstructSignatures(classType: InterfaceType): Signature[]{
2725+ let baseTypes = getBaseTypes(classType);
2726+ if (baseTypes.length) {
2727+ let baseType = baseTypes[0];
27262728 let baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), SignatureKind.Construct);
27272729 return map(baseSignatures, baseSignature => {
27282730 let signature = baseType.flags & TypeFlags.Reference ?
@@ -2844,9 +2846,10 @@ module ts {
28442846 if (!constructSignatures.length) {
28452847 constructSignatures = getDefaultConstructSignatures(classType);
28462848 }
2847- if (getBaseTypes(classType).length) {
2849+ let baseTypes = getBaseTypes(classType);
2850+ if (baseTypes.length) {
28482851 members = createSymbolTable(getNamedMembers(members));
2849- addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(getBaseTypes(classType) [0].symbol)));
2852+ addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes [0].symbol)));
28502853 }
28512854 }
28522855 stringIndexType = undefined;
@@ -5574,7 +5577,8 @@ module ts {
55745577 let baseClass: Type;
55755578 if (enclosingClass && getClassExtendsHeritageClauseElement(enclosingClass)) {
55765579 let classType = <InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass));
5577- baseClass = getBaseTypes(classType).length && getBaseTypes(classType)[0];
5580+ let baseTypes = getBaseTypes(classType);
5581+ baseClass = baseTypes.length && baseTypes[0];
55785582 }
55795583
55805584 if (!baseClass) {
@@ -9977,9 +9981,10 @@ module ts {
99779981 emitExtends = emitExtends || !isInAmbientContext(node);
99789982 checkHeritageClauseElement(baseTypeNode);
99799983 }
9980- if (getBaseTypes(type).length) {
9984+ let baseTypes = getBaseTypes(type);
9985+ if (baseTypes.length) {
99819986 if (produceDiagnostics) {
9982- let baseType = getBaseTypes(type) [0];
9987+ let baseType = baseTypes [0];
99839988 checkTypeAssignableTo(type, baseType, node.name || node, Diagnostics.Class_0_incorrectly_extends_base_class_1);
99849989 let staticBaseType = getTypeOfSymbol(baseType.symbol);
99859990 checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node,
@@ -9993,7 +9998,7 @@ module ts {
99939998 }
99949999 }
999510000
9996- if (getBaseTypes(type) .length || (baseTypeNode && compilerOptions.separateCompilation)) {
10001+ if (baseTypes .length || (baseTypeNode && compilerOptions.separateCompilation)) {
999710002 // Check that base type can be evaluated as expression
999810003 checkExpressionOrQualifiedName(baseTypeNode.expression);
999910004 }
@@ -10137,15 +10142,16 @@ module ts {
1013710142 }
1013810143
1013910144 function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean {
10140- if (!getBaseTypes(type).length || getBaseTypes(type).length === 1) {
10145+ let baseTypes = getBaseTypes(type);
10146+ if (!baseTypes.length || baseTypes.length === 1) {
1014110147 return true;
1014210148 }
1014310149
1014410150 let seen: Map<{ prop: Symbol; containingType: Type }> = {};
1014510151 forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; });
1014610152 let ok = true;
1014710153
10148- for (let base of getBaseTypes(type) ) {
10154+ for (let base of baseTypes ) {
1014910155 let properties = getPropertiesOfObjectType(base);
1015010156 for (let prop of properties) {
1015110157 if (!hasProperty(seen, prop.name)) {
0 commit comments