2018-10-09 19:38:46 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @allowJs: true
|
|
|
|
// @checkJs: true
|
|
|
|
// @noImplicitAny: true
|
|
|
|
// @Filename: important.js
|
|
|
|
/////** @param {number} a */
|
2018-10-25 00:34:15 +02:00
|
|
|
////function f(a, [|...rest|]){
|
2018-10-09 19:38:46 +02:00
|
|
|
//// a;
|
|
|
|
//// rest.push(22);
|
|
|
|
////}
|
|
|
|
|
2018-10-25 00:34:15 +02:00
|
|
|
verify.codeFix({
|
|
|
|
description: "Infer parameter types from usage",
|
2018-11-02 23:39:27 +01:00
|
|
|
index: 0,
|
2018-10-25 00:34:15 +02:00
|
|
|
newFileContent:
|
2018-10-25 01:14:52 +02:00
|
|
|
`/**
|
|
|
|
* @param {number} a
|
2018-10-09 19:38:46 +02:00
|
|
|
* @param {number[]} rest
|
|
|
|
*/
|
|
|
|
function f(a, ...rest){
|
|
|
|
a;
|
|
|
|
rest.push(22);
|
2018-10-25 00:34:15 +02:00
|
|
|
}`,
|
|
|
|
});
|