Skip to content

Local module variadic function lib signatures only have the final signature used #2369

@justinwoo

Description

@justinwoo

I haven't found a way to have overriding definitions in the source (I don't believe you're supposed to be able to?) and I tried testing a variadic function as a local untyped module and providing lib typings for it. The result was that only the final signature for the function would end up being used instead of being matched to the correct arity (whereas for external modules, the correct signature does seem to be selected, but only if the definitions are in reverse order, see #2360).

Case 1:

Case 2:

Repo with code, details: https://github.com/justinwoo/local-variadic-function-ts-flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions