@@ -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
@@ -3381,7 +3381,7 @@ namespace ts {
3381
3381
function getTypeOfFuncClassEnumModule(symbol: Symbol): Type {
3382
3382
const links = getSymbolLinks(symbol);
3383
3383
if (!links.type) {
3384
- if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModule(<ModuleDeclaration> symbol.valueDeclaration )) {
3384
+ if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModuleSymbol( symbol)) {
3385
3385
links.type = anyType;
3386
3386
}
3387
3387
else {
@@ -18365,8 +18365,8 @@ namespace ts {
18365
18365
18366
18366
function moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean {
18367
18367
let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
18368
- if (!moduleSymbol) {
18369
- // module not found - be conservative
18368
+ if (!moduleSymbol || isShorthandAmbientModuleSymbol(moduleSymbol) ) {
18369
+ // If the module is not found or is shorthand, assume that it may export a value.
18370
18370
return true;
18371
18371
}
18372
18372
0 commit comments