* get return type from `@type` tags Previously, getJSDocReturnType did not check the `@type` tag for a type node that has a return type. Now it does. * Improve doc comment of getJSDocReturnType * More type predicates in type guards! * Update API baselines with new documentation (?!)
43 lines
999 B
Plaintext
43 lines
999 B
Plaintext
=== tests/cases/conformance/jsdoc/test.js ===
|
|
// all 6 should error on return statement/expression
|
|
/** @type {(x: number) => string} */
|
|
function h(x) { return x }
|
|
>h : (x: number) => string
|
|
>x : number
|
|
>x : number
|
|
|
|
/** @type {(x: number) => string} */
|
|
var f = x => x
|
|
>f : (x: number) => string
|
|
>x => x : (x: number) => string
|
|
>x : number
|
|
>x : number
|
|
|
|
/** @type {(x: number) => string} */
|
|
var g = function (x) { return x }
|
|
>g : (x: number) => string
|
|
>function (x) { return x } : (x: number) => string
|
|
>x : number
|
|
>x : number
|
|
|
|
/** @type {{ (x: number): string }} */
|
|
function i(x) { return x }
|
|
>i : (x: number) => string
|
|
>x : number
|
|
>x : number
|
|
|
|
/** @type {{ (x: number): string }} */
|
|
var j = x => x
|
|
>j : (x: number) => string
|
|
>x => x : (x: number) => string
|
|
>x : number
|
|
>x : number
|
|
|
|
/** @type {{ (x: number): string }} */
|
|
var k = function (x) { return x }
|
|
>k : (x: number) => string
|
|
>function (x) { return x } : (x: number) => string
|
|
>x : number
|
|
>x : number
|
|
|