Merge pull request #10961 from YuichiNukiyama/change_errormessage

change error message for assigning from object
This commit is contained in:
Nathan Shively-Sanders
2016-09-21 08:47:31 -07:00
committed by GitHub
13 changed files with 143 additions and 36 deletions

View File

@@ -6502,6 +6502,9 @@ namespace ts {
if (source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.Primitive) {
tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
else if (source.symbol && source.flags & TypeFlags.ObjectType && globalObjectType === source) {
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
}
reportRelationError(headMessage, source, target);
}
return Ternary.False;

View File

@@ -1959,6 +1959,10 @@
"category": "Error",
"code": 2695
},
"The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?": {
"category": "Error",
"code": 2696
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",