Closed
Description
Bug Report
π Search Terms
function top type callable spread never regression
π Version & Regression Information
- This changed between versions 3.8.3 and 3.9.7
β― Playground Link
Playground link with relevant code
π» Code
declare let foo: (...args: never) => void;
foo = (x: string) => {};
foo(); // no error
π Actual behavior
foo()
was permitted.
π Expected behavior
foo()
should not be permitted because it is unsafe. (...args: never) => unknown
behaves as the top-type for all functions; all function types are assignable to it. So calling it will lead to unsafe behavior by functions expecting 1 or more arguments.