We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3648f0 commit 3ed23c0Copy full SHA for 3ed23c0
README.md
@@ -82,6 +82,19 @@ o = {
82
83
## Current problems and limitations
84
85
+Access to array elements through their indexes will result in a type error.
86
+
87
+```javascript
88
+let d: FixedSizeArray<2, string>;
89
90
+d = ['a', 'b']; // ok
91
+d[0] = 'a2'; // ok
92
+d[1] = 'b2'; // type error, but it is wrong!
93
+d[2] = 'c2'; // type error
94
+```
95
96
+Other more complex cases.
97
98
```javascript
99
interface Fun<N extends number, M extends number> {
100
(a: FixedSizeArray<N, number>): FixedSizeArray<M, number>;
src/test.ts
@@ -4,6 +4,7 @@ let d: FixedSizeArray<2, string>;
4
5
d = ['a', 'b']; // ok
6
d[0] = 'a2'; // ok
7
8
d[2] = 'c2'; // type error
9
d = ['a']; // type error
10
d = ['a', 'b', 'c']; // type error
0 commit comments