You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the string indexer is currently set to readonly in lib.d.ts. When trying to swap out characters in a string, you must cast to any to solve. Is this expected behavior, or a side effect of some other issue being solved?
This is not an issue for Array, as it's indexer is mutable.
Currently the string indexer is currently set to readonly in lib.d.ts. When trying to swap out characters in a string, you must cast to any to solve. Is this expected behavior, or a side effect of some other issue being solved?
This is not an issue for Array, as it's indexer is mutable.
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es5.d.ts#L442
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es6.d.ts#L442
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.d.ts#L442
TypeScript Version: 1.8.0 / nightly (2.0.0-dev.201xxxxx)
2.1.0-dev.20160801
Code
Expected behavior:
Should be able to assign a value to any index of a string;
Actual behavior:
Get compiler error
Left-hand side of assignment expression cannot be a constant or a read-only property.
The text was updated successfully, but these errors were encountered: