3 ms·
I am not convinced that parameter type inference is a reason to use flow. I have seen examples where flow fails to report errors because it can't infer the para
by Myrannas 9y ago
I am not convinced that parameter type inference is a reason to use flow. I have seen examples where flow fails to report errors because it can't infer the parameter types. I would rather consistency over inference that sometimes works sometimes fails silently.
For example:
function fn(a) {
const {b} = a;
console.log(b.c);
}
fn({});
This compiles without errors - but would fail at runtime. https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVUCuA7AxgFwEs5swpsAKAQwEowBvVMXEgZ3wYCMBfMAXjBUA3GCaiwzNnBgBTAHTwA5hU5zcNIam7pyFetw1A https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVUCuA7AxgFwEs5swp...
- andreypopp 9y agoYep, reported to Flow issue tracker.