Skip to content

Regression since 0.57.0: Inference chain gets broken in certain situations #5792

@villesau

Description

@villesau

Repro steps can be found from this comment: flow-typed/flow-typed#1731 (comment)

So in a nutshell, Flow can't infer the type from passed in object property which is assigned to object passed out. This causes unsoundness: you expect type to be what it is not. This seems pretty bad regression to me.

You can see in the test case that the component expects number, but string is passed in. If you test the libs on versions earlier than 0.57.0, Flow is able to infer the type and fails the test appropriately.

To see the issue clearly, you can remove the rest of the tests but the one comment is pointing to. Also others that top most connect definition are not relevant to point out this bug.

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