I have the following example code:
//Derived type of sum ([head, ...tail]: number[]) => any
let sum =
([head, ...tail]: number[]) => head ? head + sum(tail) : 0
let x: string = sum([1, 2, 3]);
alert(x);
Why TypeScript infers return type of product to be any? Flow reports an error for this code which, I believe, is correct.