mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
add new error message 'Cannot assign to {0} because it is a constant.'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user