-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.7.0-dev.20171024
Code
/** @param {...number} a */
function f(a) {
console.log(arguments[0]);
}
f([1, 2]); // this should fail, but passes [[1]]
f(1, 2); // this should pass, but fails [[2]]
node ./node_modules/typescript/lib/tsc.js multi.js --out multiout.js --allowjs --checkjs
Expected behavior:
Fail at [[1]] pass at [[2]]
Actual behavior:
Passes [[1]], but fails at [[2]]:
multi.js(6,3): error TS2345: Argument of type '1' is not assignable to parameter of type 'number[]'.
Regression introduced at #18825
CodinCat
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue