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.
Bug Report
🔎 Search Terms
function top type callable spread never regression
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
foo()was permitted.🙂 Expected behavior
foo()should not be permitted because it is unsafe.(...args: never) => unknownbehaves 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.