TypeScript/tests/cases/fourslash/codeFixInferFromUsageNumberIndexSignature.ts
Andy 02630273a2
codeFixInferFromUsage: Assume that using x[0] means that x is an array (#26739)
* codeFixInferFromUsage: Assume that using `x[0]` means that `x` is an array

* Remove unnecessary '||' with non-falsy LHS

If only there were some kind of type-checker for JavaScript that could detect this sort of thing
2018-08-29 11:37:31 -07:00

9 lines
229 B
TypeScript

/// <reference path='fourslash.ts' />
// @noImplicitAny: true
////function f([|a |]) {
//// return a[0] + 1;
////}
verify.rangeAfterCodeFix("a: number[]",/*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0);