When declaring a tuple type with expected types at each index, Flow doesn’t error on undefined slots. Doing the wrong type in a given index does error as expected.
Example repro at: https://gist.github.com/iamdustan/0fd4559b1339c0cb8759
/** @flow */
declare type ExampleTuple = [string, string, string];
function concat(ex:ExampleTuple): string {
return ex.join(' ');
}
concat(['hello', 'world', 'golly']);
// I would expect flow to error on this line
concat(['hello', 'world']);
// I would expect this to error, too
var x:[string] = [];
When declaring a tuple type with expected types at each index, Flow doesn’t error on undefined slots. Doing the wrong type in a given index does error as expected.
Example repro at: https://gist.github.com/iamdustan/0fd4559b1339c0cb8759