mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
revert fix for #2456 'Import namespace exports should be immutable'
This commit is contained in:
@@ -7354,23 +7354,6 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isImportedNameFromExternalModule(n: Node): boolean {
|
||||
switch (n.kind) {
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
case SyntaxKind.PropertyAccessExpression: {
|
||||
// all bindings for external module should be immutable
|
||||
// so attempt to use a.b or a[b] as lhs will always fail
|
||||
// no matter what b is
|
||||
let symbol = findSymbol((<PropertyAccessExpression | ElementAccessExpression>n).expression);
|
||||
return symbol && symbol.flags & SymbolFlags.Alias && isExternalModuleSymbol(resolveAlias(symbol));
|
||||
}
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return isImportedNameFromExternalModule((<ParenthesizedExpression>n).expression);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isReferenceOrErrorExpression(n)) {
|
||||
error(n, invalidReferenceMessage);
|
||||
return false;
|
||||
@@ -7381,10 +7364,6 @@ module ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isImportedNameFromExternalModule(n)) {
|
||||
error(n, invalidReferenceMessage);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user