@@ -35217,39 +35217,36 @@ namespace ts {
3521735217 const target = resolveAlias(symbol);
3521835218
3521935219 if (target !== unknownSymbol) {
35220- const shouldSkipWithJSExpandoTargets = symbol.flags & SymbolFlags.Assignment;
35221- if (!shouldSkipWithJSExpandoTargets) {
35222- // For external modules symbol represents local symbol for an alias.
35223- // This local symbol will merge any other local declarations (excluding other aliases)
35224- // and symbol.flags will contains combined representation for all merged declaration.
35225- // Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have,
35226- // otherwise it will conflict with some local declaration). Note that in addition to normal flags we include matching SymbolFlags.Export*
35227- // in order to prevent collisions with declarations that were exported from the current module (they still contribute to local names).
35228- symbol = getMergedSymbol(symbol.exportSymbol || symbol);
35229- const excludedMeanings =
35230- (symbol.flags & (SymbolFlags.Value | SymbolFlags.ExportValue) ? SymbolFlags.Value : 0) |
35231- (symbol.flags & SymbolFlags.Type ? SymbolFlags.Type : 0) |
35232- (symbol.flags & SymbolFlags.Namespace ? SymbolFlags.Namespace : 0);
35233- if (target.flags & excludedMeanings) {
35234- const message = node.kind === SyntaxKind.ExportSpecifier ?
35235- Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
35236- Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
35237- error(node, message, symbolToString(symbol));
35238- }
35239-
35240- // Don't allow to re-export something with no value side when `--isolatedModules` is set.
35241- if (compilerOptions.isolatedModules
35242- && node.kind === SyntaxKind.ExportSpecifier
35243- && !node.parent.parent.isTypeOnly
35244- && !(target.flags & SymbolFlags.Value)
35245- && !(node.flags & NodeFlags.Ambient)) {
35246- error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
35247- }
35220+ // For external modules, `symbol` represents the local symbol for an alias.
35221+ // This local symbol will merge any other local declarations (excluding other aliases)
35222+ // and symbol.flags will contains combined representation for all merged declaration.
35223+ // Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have,
35224+ // otherwise it will conflict with some local declaration). Note that in addition to normal flags we include matching SymbolFlags.Export*
35225+ // in order to prevent collisions with declarations that were exported from the current module (they still contribute to local names).
35226+ symbol = getMergedSymbol(symbol.exportSymbol || symbol);
35227+ const excludedMeanings =
35228+ (symbol.flags & (SymbolFlags.Value | SymbolFlags.ExportValue) ? SymbolFlags.Value : 0) |
35229+ (symbol.flags & SymbolFlags.Type ? SymbolFlags.Type : 0) |
35230+ (symbol.flags & SymbolFlags.Namespace ? SymbolFlags.Namespace : 0);
35231+ if (target.flags & excludedMeanings) {
35232+ const message = node.kind === SyntaxKind.ExportSpecifier ?
35233+ Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
35234+ Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
35235+ error(node, message, symbolToString(symbol));
35236+ }
35237+
35238+ // Don't allow to re-export something with no value side when `--isolatedModules` is set.
35239+ if (compilerOptions.isolatedModules
35240+ && node.kind === SyntaxKind.ExportSpecifier
35241+ && !node.parent.parent.isTypeOnly
35242+ && !(target.flags & SymbolFlags.Value)
35243+ && !(node.flags & NodeFlags.Ambient)) {
35244+ error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
3524835245 }
3524935246
3525035247 if (isImportSpecifier(node) &&
3525135248 (target.valueDeclaration && target.valueDeclaration.flags & NodeFlags.Deprecated
35252- || every(target.declarations, d => !!(d.flags & NodeFlags.Deprecated)))) {
35249+ || every(target.declarations, d => !!(d.flags & NodeFlags.Deprecated)))) {
3525335250 errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
3525435251 }
3525535252 }
0 commit comments