TypeScript/tests/cases/fourslash/codeFixInferFromUsageNumberIndexSignatureJS.ts

22 lines
384 B
TypeScript
Raw Normal View History

/// <reference path='fourslash.ts' />
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @Filename: important.js
////function f([|a|]) {
//// return a[0] + 1;
////}
verify.codeFix({
description: "Infer parameter types from usage",
index: 0,
newFileContent:
`/**
* @param {number[]} a
*/
function f(a) {
return a[0] + 1;
}`,
});