/
checkJsdocTypeTagOnObjectProperty2.errors.txt
49 lines (46 loc) · 2.19 KB
/
checkJsdocTypeTagOnObjectProperty2.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
tests/cases/conformance/jsdoc/0.js(5,3): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsdoc/0.js(8,7): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsdoc/0.js(11,20): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsdoc/0.js(13,15): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsdoc/0.js(15,3): error TS2322: Type 'undefined' is not assignable to type 'string'.
tests/cases/conformance/jsdoc/0.js(19,5): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsdoc/0.js(22,5): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsdoc/0.js(22,22): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
==== tests/cases/conformance/jsdoc/0.js (8 errors) ====
// @ts-check
var lol;
const obj = {
/** @type {string|undefined} */
bar: 42,
~~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
/** @type {function(number): number} */
method1(n1) {
return "42";
~~~~~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
},
/** @type {function(number): number} */
method2: (n1) => "lol",
~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
/** @type {function(number): number} */
arrowFunc: (num="0") => num + 42,
~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
/** @type {string} */
lol
~~~
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
}
lol = "string"
/** @type {string} */
var s = obj.method1(0);
~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
/** @type {string} */
var s1 = obj.method2("0");
~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
~~~
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.