mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Updated error message.
This commit is contained in:
@@ -4832,7 +4832,14 @@ namespace ts {
|
||||
sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType);
|
||||
targetType = typeToString(target, /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType);
|
||||
}
|
||||
reportError(message || Diagnostics.Type_0_is_not_assignable_to_type_1, sourceType, targetType);
|
||||
|
||||
if (!message) {
|
||||
message = relation === comparableRelation ?
|
||||
Diagnostics.Type_0_is_not_comparable_with_type_1 :
|
||||
Diagnostics.Type_0_is_not_assignable_to_type_1
|
||||
}
|
||||
|
||||
reportError(message, sourceType, targetType);
|
||||
}
|
||||
|
||||
// Compare two types and return
|
||||
@@ -9411,7 +9418,7 @@ namespace ts {
|
||||
let widenedType = getWidenedType(exprType);
|
||||
|
||||
if (!isTypeComparableTo(targetType, widenedType)) {
|
||||
checkTypeComparableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other);
|
||||
checkTypeComparableTo(exprType, targetType, node);
|
||||
}
|
||||
}
|
||||
return targetType;
|
||||
|
||||
@@ -888,6 +888,10 @@
|
||||
"category": "Error",
|
||||
"code": 2322
|
||||
},
|
||||
"Type '{0}' is not comparable with type '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 2323
|
||||
},
|
||||
"Property '{0}' is missing in type '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 2324
|
||||
@@ -996,10 +1000,6 @@
|
||||
"category": "Error",
|
||||
"code": 2351
|
||||
},
|
||||
"Neither type '{0}' nor type '{1}' is assignable to the other.": {
|
||||
"category": "Error",
|
||||
"code": 2352
|
||||
},
|
||||
"Object literal may only specify known properties, and '{0}' does not exist in type '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 2353
|
||||
|
||||
Reference in New Issue
Block a user