Merge branch 'master' into resolveJsonModuleError

This commit is contained in:
Sheetal Nandi
2018-07-25 17:32:22 -07:00
31 changed files with 139 additions and 148 deletions
+3 -2
View File
@@ -20047,7 +20047,8 @@ namespace ts {
if (produceDiagnostics && targetType !== errorType) {
const widenedType = getWidenedType(exprType);
if (!isTypeComparableTo(targetType, widenedType)) {
checkTypeComparableTo(exprType, targetType, errNode, Diagnostics.Type_0_cannot_be_converted_to_type_1);
checkTypeComparableTo(exprType, targetType, errNode,
Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);
}
}
return targetType;
@@ -21521,7 +21522,7 @@ namespace ts {
// in tagged templates.
forEach(node.templateSpans, templateSpan => {
if (maybeTypeOfKind(checkExpression(templateSpan.expression), TypeFlags.ESSymbolLike)) {
error(templateSpan.expression, Diagnostics.Type_0_cannot_be_converted_to_type_1, typeToString(esSymbolType), typeToString(stringType));
error(templateSpan.expression, Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String);
}
});
+6 -2
View File
@@ -1196,7 +1196,7 @@
"category": "Error",
"code": 2351
},
"Type '{0}' cannot be converted to type '{1}'.": {
"Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.": {
"category": "Error",
"code": 2352
},
@@ -2421,10 +2421,14 @@
"category": "Error",
"code": 2730
},
"Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension": {
"Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'.": {
"category": "Error",
"code": 2731
},
"Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension": {
"category": "Error",
"code": 2732
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",