Skip to content

Issue with flow and curry #462

Closed
Closed
@sobolevn

Description

@sobolevn

This test does not work when #461

- case: flow_function_with_curried1
  disable_cache: true
  main: |
    from returns.pipeline import flow
    from returns.curry import curry
    from returns.functions import identity

    @curry
    def curried(a: int, b: int, c: str) -> float:
        ...

    reveal_type(flow(1, curried, identity)(2)('a'))  # N: Revealed type is 'builtins.float'
    reveal_type(flow(1, curried, identity)(2, 'a'))  # N: Revealed type is 'builtins.float'

Output:

» mypy ex.py                                                   
ex.py:9: note: Revealed type is 'builtins.float'
ex.py:9: error: Argument 2 to "_flow" has incompatible type overloaded function; expected overloaded function
ex.py:10: note: Revealed type is 'builtins.float'
ex.py:10: error: Argument 2 to "_flow" has incompatible type overloaded function; expected overloaded function

This also looks like a bug in mypy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions