Type alias cannot have reserved type name (#1030)

This commit is contained in:
Anders Hejlsberg
2014-11-02 07:01:03 -08:00
parent 10681c7209
commit 538e7ea3d3
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -7697,6 +7697,7 @@ module ts {
}
function checkTypeAliasDeclaration(node: TypeAliasDeclaration) {
checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0);
checkSourceElement(node.type);
}
@@ -269,6 +269,7 @@ module ts {
The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." },
Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." },
Type_alias_0_circularly_references_itself: { code: 2456, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." },
Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
+4
View File
@@ -1076,6 +1076,10 @@
"category": "Error",
"code": 2456
},
"Type alias name cannot be '{0}'": {
"category": "Error",
"code": 2457
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",