Skip to content
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

False positive of mismatch in overloaded function (with positional-only argument) #2006

Closed
Azureblade3808 opened this issue Oct 29, 2021 · 3 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@Azureblade3808
Copy link

Environment data

  • Language Server version: 2021.10.4-pre.1
  • OS and version: Windows7 x64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.8.12 Anaconda

Sample code

from __future__ import annotations
from typing import Any, overload

@overload
def f0(x: int, /, y: str) -> Any: ...
@overload
def f0(x: float, /, y: str, z: bytes | None = ...) -> Any: ...
def f0(x: int | float, /, y: str, z: bytes | None = None) -> Any: ...

@overload
def f1(x: int, y: str) -> Any: ...
@overload
def f1(x: float, y: str, z: bytes | None = ...) -> Any: ...
def f1(x: int | float, y: str, z: bytes | None = None) -> Any: ...

@overload
def f2(x: int, /) -> Any: ...
@overload
def f2(x: float, /, y: str | None = ...) -> Any: ...
def f2(x: int | float, /, y: str | None = None) -> Any: ...

Expected behavior

No reporting.

Actual behavior

There is a warning about f0, but no warnings about f1 or f2.
image

@erictraut
Copy link
Contributor

Thanks for the bug report. I've confirmed the repro case, and I've created a tracking bug in the pyright issue tracker.

@erictraut erictraut added bug Something isn't working and removed triage labels Oct 29, 2021
@erictraut
Copy link
Contributor

This will be fixed in the next release.

@erictraut erictraut added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Oct 30, 2021
@heejaechang
Copy link
Contributor

fixed in 2021.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants