@@ -1043,7 +1043,7 @@ namespace ts {
1043
1043
const moduleSymbol = resolveExternalModuleName(node, (<ImportDeclaration>node.parent).moduleSpecifier);
1044
1044
1045
1045
if (moduleSymbol) {
1046
- const exportDefaultSymbol = isShorthandAmbientModule (moduleSymbol.valueDeclaration ) ?
1046
+ const exportDefaultSymbol = isShorthandAmbientModuleSymbol (moduleSymbol) ?
1047
1047
moduleSymbol :
1048
1048
moduleSymbol.exports["export="] ?
1049
1049
getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@@ -1119,7 +1119,7 @@ namespace ts {
1119
1119
if (targetSymbol) {
1120
1120
const name = specifier.propertyName || specifier.name;
1121
1121
if (name.text) {
1122
- if (isShorthandAmbientModule (moduleSymbol.valueDeclaration )) {
1122
+ if (isShorthandAmbientModuleSymbol (moduleSymbol)) {
1123
1123
return moduleSymbol;
1124
1124
}
1125
1125
@@ -3382,7 +3382,7 @@ namespace ts {
3382
3382
function getTypeOfFuncClassEnumModule(symbol: Symbol): Type {
3383
3383
const links = getSymbolLinks(symbol);
3384
3384
if (!links.type) {
3385
- if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModule(<ModuleDeclaration> symbol.valueDeclaration )) {
3385
+ if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModuleSymbol( symbol)) {
3386
3386
links.type = anyType;
3387
3387
}
3388
3388
else {
@@ -18371,8 +18371,8 @@ namespace ts {
18371
18371
18372
18372
function moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean {
18373
18373
let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
18374
- if (!moduleSymbol) {
18375
- // module not found - be conservative
18374
+ if (!moduleSymbol || isShorthandAmbientModuleSymbol(moduleSymbol) ) {
18375
+ // If the module is not found or is shorthand, assume that it may export a value.
18376
18376
return true;
18377
18377
}
18378
18378
0 commit comments