add new error message 'Cannot assign to {0} because it is a constant.'

This commit is contained in:
Alexander T
2018-11-03 15:42:00 +02:00
committed by Alexander
parent 29dc7b2811
commit 28fc0a28b0
8 changed files with 54 additions and 45 deletions
+6 -1
View File
@@ -15891,7 +15891,12 @@ namespace ts {
return errorType;
}
if (isReadonlySymbol(localOrExportSymbol)) {
error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol));
if (localOrExportSymbol.flags & SymbolFlags.Variable) {
error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol));
}
else {
error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol));
}
return errorType;
}
}
+4
View File
@@ -2124,6 +2124,10 @@
"category": "Error",
"code": 2587
},
"Cannot assign to '{0}' because it is a constant.": {
"category": "Error",
"code": 2588
},
"JSX element attributes type '{0}' may not be a union type.": {
"category": "Error",
"code": 2600