@@ -2424,12 +2424,15 @@ namespace ts {
24242424 const visitedSymbolTables: SymbolTable[] = [];
24252425 return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable);
24262426
2427- function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable): Symbol[] | undefined {
2427+ /**
2428+ * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already)
2429+ */
2430+ function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable, ignoreQualification?: boolean): Symbol[] | undefined {
24282431 if (!pushIfUnique(visitedSymbolTables, symbols)) {
24292432 return undefined;
24302433 }
24312434
2432- const result = trySymbolTable(symbols);
2435+ const result = trySymbolTable(symbols, ignoreQualification );
24332436 visitedSymbolTables.pop();
24342437 return result;
24352438 }
@@ -2441,22 +2444,22 @@ namespace ts {
24412444 !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing);
24422445 }
24432446
2444- function isAccessible(symbolFromSymbolTable: Symbol, resolvedAliasSymbol?: Symbol) {
2447+ function isAccessible(symbolFromSymbolTable: Symbol, resolvedAliasSymbol?: Symbol, ignoreQualification?: boolean ) {
24452448 return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) &&
24462449 // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table)
24472450 // and if symbolFromSymbolTable or alias resolution matches the symbol,
24482451 // check the symbol can be qualified, it is only then this symbol is accessible
24492452 !some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) &&
2450- canQualifySymbol(symbolFromSymbolTable, meaning);
2453+ (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning) );
24512454 }
24522455
24532456 function isUMDExportSymbol(symbol: Symbol) {
24542457 return symbol && symbol.declarations && symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
24552458 }
24562459
2457- function trySymbolTable(symbols: SymbolTable) {
2460+ function trySymbolTable(symbols: SymbolTable, ignoreQualification: boolean | undefined ) {
24582461 // If symbol is directly available by its name in the symbol table
2459- if (isAccessible(symbols.get(symbol.escapedName))) {
2462+ if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification )) {
24602463 return [symbol];
24612464 }
24622465
@@ -2469,14 +2472,14 @@ namespace ts {
24692472 && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration))) {
24702473
24712474 const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
2472- if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) {
2475+ if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification )) {
24732476 return [symbolFromSymbolTable];
24742477 }
24752478
24762479 // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain
24772480 // but only if the symbolFromSymbolTable can be qualified
24782481 const candidateTable = getExportsOfSymbol(resolvedImportedSymbol);
2479- const accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable);
2482+ const accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, /*ignoreQualification*/ true );
24802483 if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) {
24812484 return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);
24822485 }
@@ -13048,7 +13051,7 @@ namespace ts {
1304813051 node.parent.kind === SyntaxKind.NonNullExpression ||
1304913052 declaration.kind === SyntaxKind.VariableDeclaration && (<VariableDeclaration>declaration).exclamationToken ||
1305013053 declaration.flags & NodeFlags.Ambient;
13051- const initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, getRootDeclaration( declaration) as VariableLikeDeclaration) : type) :
13054+ const initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration as VariableLikeDeclaration) : type) :
1305213055 type === autoType || type === autoArrayType ? undefinedType :
1305313056 getOptionalType(type);
1305413057 const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized);
@@ -15310,7 +15313,7 @@ namespace ts {
1531015313
1531115314 // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type.
1531215315 // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass.
15313- if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || (<ResolvedType>sourceAttributesType).properties .length > 0)) {
15316+ if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType (<ResolvedType>sourceAttributesType).length > 0)) {
1531415317 error(openingLikeElement, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(getJsxElementPropertiesName()));
1531515318 }
1531615319 else {
@@ -16717,7 +16720,7 @@ namespace ts {
1671716720 const isDecorator = node.kind === SyntaxKind.Decorator;
1671816721 const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
1671916722
16720- let typeArguments: ReadonlyArray <TypeNode>;
16723+ let typeArguments: NodeArray <TypeNode>;
1672116724
1672216725 if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) {
1672316726 typeArguments = (<CallExpression>node).typeArguments;
@@ -16846,7 +16849,7 @@ namespace ts {
1684616849 max = Math.max(max, length(sig.typeParameters));
1684716850 }
1684816851 const paramCount = min < max ? min + "-" + max : min;
16849- diagnostics.add(createDiagnosticForNode( node, Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length));
16852+ diagnostics.add(createDiagnosticForNodeArray(getSourceFileOfNode( node), typeArguments , Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length));
1685016853 }
1685116854 else if (args) {
1685216855 let min = Number.POSITIVE_INFINITY;
@@ -21030,6 +21033,7 @@ namespace ts {
2103021033 }
2103121034 break;
2103221035 case SyntaxKind.IndexSignature:
21036+ case SyntaxKind.SemicolonClassElement:
2103321037 // Can't be private
2103421038 break;
2103521039 default:
0 commit comments