mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 13:59:04 -05:00
Given import * of an export = module, raise an error but still return a symbol.
This commit is contained in:
@@ -1684,10 +1684,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