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
test.ts:4:11 - error TS1354: 'readonly' type modifier is only permitted on array and tuple literal types.
4 type RA = readonly A;
~~~~~~~~
test.ts:5:11 - error TS1354: 'readonly' type modifier is only permitted on array and tuple literal types.
5 type RT = readonly T;
~~~~~~~~
Found 4 errors.
This is the current design. We have special syntax and semantics for these types only.
This might change in the future, but the most likely change is that readonly could be applied to any type.
TypeScript Version: 3.5.1
Search Terms:
readonly, type alias, tuple, array
Code
Expected behavior:
There is no errors, like in the following example:
Actual behavior:
Compile errors:
Playground Link: http://www.typescriptlang.org/play/index.html#code/C4TwDgpgBAglC8UB2BXAtgIwgJwNoF0BuAKFEigBUEpdVMcAaZdLbI408aAJTkWwgBDACYB7JABsQsEmR5V+QsZOkVCQA
Related Issues:
#12
The text was updated successfully, but these errors were encountered: