Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix Seq.of flow error for immutable@^3 #1435

Copy link
Copy link
Open
@jedwards1211

Description

@jedwards1211
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.