Closed
Description
// @ts-check
/**
* @overload
* @param {number} x
*/
/**
* @overload
* @param {string} x
*/
/**
* @param {string | number} x
* @returns {string | number}
*/
function id(x) {
return x;
}
export let a = id(123);
export let b = id("hello");
Here, the first two signatures of id
are missing an @return
/@returns
tag. That means that they're implicitly any
.
Under noImplicitAny
, this example should issue an error on both @overload
tags saying that they implicitly return the type any
.