Provide better error message

This commit is contained in:
Andy Hanson
2016-12-07 13:13:21 -08:00
parent 7beeb77201
commit 39040f6154
3 changed files with 10 additions and 9 deletions

View File

@@ -479,6 +479,9 @@ namespace ts {
}
recordMergedSymbol(target, source);
}
else if (target.flags & SymbolFlags.NamespaceModule) {
error(source.valueDeclaration.name, Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
}
else {
const message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable
? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0;

View File

@@ -1807,6 +1807,10 @@
"category": "Error",
"code": 2608
},
"Cannot augment module '{0}' with value exports because it resolves to a non-module entity.": {
"category": "Error",
"code": 2649
},
"Cannot emit namespaced JSX elements in React": {
"category": "Error",
"code": 2650