Closed
Description
TypeScript Version: 2.5.3
Code
if(columnIndex === null) return (_:number) => null;
return (rowIndex:number) => table.rows[rowIndex].rowValues[columnIndex];
Expected behavior:
No type errors.
Actual behavior:
error TS2538: Type 'null' cannot be used as an index type.
(referring to the columnIndex variable captured by the lambda expression)
Work around:
The type error goes away if I instead do:
return (rowIndex:number) => table.rows[rowIndex].rowValues[columnIndex as number];
However that shouldn't be necessary.