Skip to content

Commit ab87dbb

Browse files
authored
Update index-signatures.md
1 parent b436c06 commit ab87dbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/types/index-signatures.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,10 @@ type FromIndex = { [k in Index]?: number }
176176

177177
const good: FromIndex = {b:1, c:2}
178178

179+
// Error:
179180
// Type '{ b: number; c: number; d: number; }' is not assignable to type 'FromIndex'.
180181
// Object literal may only specify known properties, and 'd' does not exist in type 'FromIndex'.
181-
const bad: FromIndex = {b:1, c:2, d:3} //
182+
const bad: FromIndex = {b:1, c:2, d:3};
182183
```
183184
This is often used together with `keyof typeof` to capture vocabulary types, described on the next page.
184185

0 commit comments

Comments
 (0)