Open
Description
After upgrading to Flow 0.56, it looks like, for better or worse, Flow is going to require static methods on a derived class to return a subtype of what the same static method on the base class returns. This causes the following error:
Error: node_modules/immutable/dist/immutable.js.flow:399
399: static of<T>(...values: T[]): SetSeq<T>;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. This type is incompatible with
380: static of<T>(...values: T[]): IndexedSeq<T>;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type
This parameter is incompatible:
399: static of<T>(...values: T[]): SetSeq<T>;
^^^^^^^^^ SetSeq. This type is incompatible with
380: static of<T>(...values: T[]): IndexedSeq<T>;
^^^^^^^^^^^^^ IndexedSeq
Found 1 error
I wanted to submit a PR to fix this but I can't but there's no branch for version 3.x.x. This error can be fixed by changing line 380 from
static of<T>(...values: T[]): IndexedSeq<T>;
to
static of<T>(...values: T[]): Seq<any, T>;
Could you make that change and release it?
Someone may be depending on the fact that Seq.of
returns an IndexedSeq
...but they could fix that by using IndexedSeq.of
instead.