Skip to content

Commit 4fcfd2d

Browse files
committed
Changed 14.7
1 parent 46e3fae commit 4fcfd2d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/03-art-of-type-arguments/14.7-string-number-union.problem.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ type tests = [
1313
Expect<Equal<typeof result1, { output: "a" }>>,
1414
Expect<Equal<typeof result2, { output: 123 }>>
1515
];
16+
17+
// @ts-expect-error
18+
const error1 = inferItemLiteral({
19+
a: 1,
20+
});
21+
22+
// @ts-expect-error
23+
const error2 = inferItemLiteral([1, 2]);

src/03-art-of-type-arguments/14.7-string-number-union.solution.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,13 @@ const result2 = inferItemLiteral(123);
1111

1212
type tests = [
1313
Expect<Equal<typeof result1, { output: "a" }>>,
14-
Expect<Equal<typeof result2, { output: 123 }>>,
14+
Expect<Equal<typeof result2, { output: 123 }>>
1515
];
16+
17+
// @ts-expect-error
18+
const error1 = inferItemLiteral({
19+
a: 1,
20+
});
21+
22+
// @ts-expect-error
23+
const error2 = inferItemLiteral([1, 2]);

0 commit comments

Comments
 (0)