Add new error message for being possibly 'void'.

This commit is contained in:
Daniel Rosenwasser
2020-10-09 16:48:23 -07:00
parent a109b5d5c8
commit add2833769
2 changed files with 6 additions and 1 deletions

View File

@@ -25571,7 +25571,7 @@ namespace ts {
function checkNonNullNonVoidType(type: Type, node: Node): Type {
const nonNullType = checkNonNullType(type, node);
if (nonNullType !== errorType && nonNullType.flags & TypeFlags.Void) {
error(node, Diagnostics.Object_is_possibly_undefined);
error(node, Diagnostics.Object_is_possibly_void);
}
return nonNullType;
}

View File

@@ -3059,6 +3059,11 @@
"category": "Error",
"code": 2796
},
"Object is possibly 'void'.": {
"category": "Error",
"code": 2797
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",