Skip to content

Flow type definition outdated, not working with last year changes  #1943

Open
@mouton-rebelle

Description

@mouton-rebelle

What happened

Updating Flow to 0.193 breaks Immutable static collection creator

How to reproduce

I tried to build a PR, but just upgrading flow to 0.193 on this repo raises 19 errors.
The problematic use case for me : I can no longer use static method to create my collection, due to changes to flow empty array / object behavior...

My simple test case :

// @flow

import * as Immutable from 'immutable'

type Person = {| name: string |}
type ListOfPerson = Immutable.List<Person>
const createdFromClassConstructor: ListOfPerson = new Immutable.List<Person>()

const toto: Person = { name: 'toto' }
const arrayOfToto: $ReadOnlyArray<Person> = [toto]

const createdFormStatic: ListOfPerson = Immutable.List(arrayOfToto)

Any plans to fix the library definition to support more recent flow versions ?

Thanks a lot

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