mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-07 17:29:36 -05:00
Merge pull request #15673 from Microsoft/import-star-export-equals
Given `import *` of an `export =` module, raise an error but still return a symbol.
This commit is contained in:
@@ -1720,10 +1720,9 @@ namespace ts {
|
||||
// references a symbol that is at least declared as a module or a variable. The target of the 'export =' may
|
||||
// combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable).
|
||||
function resolveESModuleSymbol(moduleSymbol: Symbol, moduleReferenceExpression: Expression, dontResolveAlias: boolean): Symbol {
|
||||
let symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
||||
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
||||
if (!dontResolveAlias && symbol && !(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) {
|
||||
error(moduleReferenceExpression, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol));
|
||||
symbol = undefined;
|
||||
}
|
||||
return symbol;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user