TypeScript/tests/cases/fourslash/codeFixInferFromUsageOptionalParamJS.ts

26 lines
388 B
TypeScript
Raw Normal View History

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