Open
Description
declare type F = (s: string, n?: number) => boolean;
type Tuple = Parameters<F>;
declare function g(...args: Parameters<F>): boolean;
g("hi")
Cannot call g
because rest array [1] has 1 element but tuple type [2] has 2 elements. [invalid-tuple-arity]
Flow version: master
Expected behavior
Type is tuple with optional arity
Actual behavior
Tuple is fixed length
- Link to Try-Flow or Github repo:
Flow
typescript