TypeScript/tests/cases/compiler/jsdocRestParameter_es6.ts
Andy 4b96edf72f
Treat ... in jsdoc type as creating a synthetic rest parameter -- not as an array type (#19483)
* Treat `...` in jsdoc type as creating a synthetic rest parameter -- not as an array type

* Change type parsing so `...T[]` parses as `...(T[])` and not `(...T)[]`

* Replace the last parameter with ...args, and make access to it potentially undefined

* Code review
2017-11-15 13:04:08 -08:00

11 lines
159 B
TypeScript

// @allowJs: true
// @checkJs: true
// @strict: true
// @noEmit: true
// @Filename: /a.js
/** @param {...number} a */
function f(...a) {
a; // number[]
}