mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 00:36:29 -05:00
address code review feedback
This commit is contained in:
@@ -1202,10 +1202,17 @@ namespace ts {
|
||||
}
|
||||
|
||||
function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation: Node, name: string, meaning: SymbolFlags): boolean {
|
||||
if (meaning & (SymbolFlags.Value & ~SymbolFlags.NamespaceModule)) {
|
||||
if (meaning & (SymbolFlags.Value & ~SymbolFlags.NamespaceModule & ~SymbolFlags.Type)) {
|
||||
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.NamespaceModule & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined));
|
||||
if (symbol) {
|
||||
error(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_value_here_because_it_has_no_value_export, name);
|
||||
error(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_value, name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (meaning & (SymbolFlags.Type & ~SymbolFlags.NamespaceModule & ~SymbolFlags.Value)) {
|
||||
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.NamespaceModule & ~SymbolFlags.Type, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined));
|
||||
if (symbol) {
|
||||
error(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_type, name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2099,10 +2099,14 @@
|
||||
"category": "Error",
|
||||
"code": 2707
|
||||
},
|
||||
"Cannot use namespace '{0}' as a value here because it has no value export.": {
|
||||
"Cannot use namespace '{0}' as a value.": {
|
||||
"category": "Error",
|
||||
"code": 2708
|
||||
},
|
||||
"Cannot use namespace '{0}' as a type.": {
|
||||
"category": "Error",
|
||||
"code": 2709
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
||||
Reference in New Issue
Block a user