Skip to content

Bug with apply and curry #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sobolevn opened this issue Jul 11, 2020 · 1 comment
Closed

Bug with apply and curry #459

sobolevn opened this issue Jul 11, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sobolevn
Copy link
Member

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
@sobolevn sobolevn added bug Something isn't working help wanted Extra attention is needed labels Jul 11, 2020
@sobolevn
Copy link
Member Author

sobolevn commented Aug 4, 2020

Duplicate of #462

@sobolevn sobolevn marked this as a duplicate of #462 Aug 4, 2020
@sobolevn sobolevn closed this as completed Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

1 participant