25 lines
954 B
Plaintext
25 lines
954 B
Plaintext
tests/cases/conformance/jsdoc/returns.js(6,5): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
tests/cases/conformance/jsdoc/returns.js(13,5): error TS2322: Type 'number | boolean' is not assignable to type 'string | number'.
|
|
Type 'boolean' is not assignable to type 'string | number'.
|
|
|
|
|
|
==== tests/cases/conformance/jsdoc/returns.js (2 errors) ====
|
|
// @ts-check
|
|
/**
|
|
* @returns {string} This comment is not currently exposed
|
|
*/
|
|
function f() {
|
|
return 5;
|
|
~~~~~~~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
}
|
|
|
|
/**
|
|
* @returns {string | number} This comment is not currently exposed
|
|
*/
|
|
function f1() {
|
|
return 5 || true;
|
|
~~~~~~~~~~~~~~~~~
|
|
!!! error TS2322: Type 'number | boolean' is not assignable to type 'string | number'.
|
|
!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'.
|
|
} |