Skip to content

Bug with apply and curry #459

Closed
Closed
@sobolevn

Description

@sobolevn

It is happenening with the lastest version and 0.14 as well:

Failing code:

from returns.io import IO
from returns.curry import curry

@curry
def fails(a1: int, a2: str, a3: str) -> str:
    return str(a1) + a2 + a3

def works(arg: int) -> str:
    ...

reveal_type(IO(1).apply(IO(works)))
reveal_type(IO(1).apply(IO(fails)))

Output:

» mypy ex.py
ex.py:20: note: Revealed type is 'returns.io.IO[builtins.str*]'
ex.py:21: note: Revealed type is 'returns.io.IO[Overload(def (a2: builtins.str, a3: builtins.str) -> builtins.str, def (a2: builtins.str) -> def (a3: builtins.str) -> builtins.str)]'
ex.py:21: error: Argument 1 to "IO" has incompatible type overloaded function; expected overloaded function

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions