Files
tsgo/testdata/baselines/reference/submodule/compiler/argumentsObjectCreatesRestForJs.errors.txt
2025-10-28 01:34:05 +00:00

26 lines
751 B
Plaintext

main.js(3,9): error TS2554: Expected 0 arguments, but got 3.
main.js(6,16): error TS2554: Expected 0-2 arguments, but got 3.
==== main.js (2 errors) ====
function allRest() { arguments; }
allRest();
allRest(1, 2, 3);
~~~~~~~
!!! error TS2554: Expected 0 arguments, but got 3.
function someRest(x, y) { arguments; }
someRest(); // x and y are still optional because they are in a JS file
someRest(1, 2, 3);
~
!!! error TS2554: Expected 0-2 arguments, but got 3.
/**
* @param {number} x - a thing
*/
function jsdocced(x) { arguments; }
jsdocced(1);
function dontDoubleRest(x, ...y) { arguments; }
dontDoubleRest(1, 2, 3);