forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
/
checkJsdocSatisfiesTag12.errors.txt
64 lines (51 loc) · 1.54 KB
/
checkJsdocSatisfiesTag12.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/a.js(24,20): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T1'.
/a.js(44,25): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T2'.
/a.js(51,6): error TS1360: Type 'number' does not satisfy the expected type 'string'.
==== /a.js (3 errors) ====
/**
* @typedef {Object} T1
* @property {number} a
*/
/**
* @typedef {Object} T2
* @property {string} a
*/
/**
* @typedef {Object} T3
* @property {"a" | "b"} a
*/
/**
* @satisfies {T1}
*/
const t1 = { a: 1 };
/**
* @satisfies {T1}
*/
const t2 = { a: 1, b: 1 };
~
!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T1'.
/**
* @satisfies {T1}
*/
const t3 = {};
/**
* @satisfies {Array.<number, number>}
*/
const t4 = [1, 2];
/**
* @satisfies {T2}
*/
const t5 = { a: 'test' };
/**
* @satisfies {T2}
*/
const t6 = { a: 'test', b: 'test' };
~
!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T2'.
/**
* @satisfies {T3}
*/
const t7 = { a: "a" };
/** @satisfies {string} */ const t8 = (1);
~~~~~~~~~
!!! error TS1360: Type 'number' does not satisfy the expected type 'string'.