improve array index checks
marcellourbani opened this issue · 1 comments
marcellourbani commented
By detault typescript doesn't handle array types correctly:
const foo:string[]=[]
const bar:string = foo[0] // type checks, but bar is undefined
If we enable compiler option noUncheckedIndexedAccess, it returns an error:
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
connor4312 commented
See #160 (comment)