* No errr on unmatchable `@param` tags Such as when the initializer is not a function, or when the function mentions `arguments` in its body. * Do not require dummy param for JS uses of arguments 1. JS functions that use `arguments` do not require a dummy parameter in order to get a type for the synthetic `args` parameter if there is an `@param` with a `...` type. 2.JS functions that use `arguments` and have an `@param` must have a type that is a `...` type. * Check for array type instead of syntactic `...` * Address PR comments * Update baselines
27 lines
443 B
TypeScript
27 lines
443 B
TypeScript
// @noEmit: true
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @strict: true
|
|
// @Filename: decls.d.ts
|
|
declare function factory(type: string): {};
|
|
// @Filename: a.js
|
|
|
|
/**
|
|
* @param {string} first
|
|
*/
|
|
function concat(/* first, second, ... */) {
|
|
var s = ''
|
|
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
s += arguments[i]
|
|
}
|
|
return s
|
|
}
|
|
|
|
/**
|
|
* @param {...string} strings
|
|
*/
|
|
function correct() {
|
|
arguments
|
|
}
|
|
|
|
correct(1,2,3) // oh no
|