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

Methods using identical signature are recognized as incompatible (Callable and TypeVar involved) #1807

Closed
Azureblade3808 opened this issue Sep 12, 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.9.2-pre.1
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.11 Anaconda

Sample code

from __future__ import annotations

from typing import Callable, Protocol, TypeVar

_T = TypeVar("_T")

class P(Protocol):
    def f(self, item: _T, build_expr: Callable[[_T], str]) -> str:
        ...

class C:
    def f(self, item: _T, build_expr: Callable[[_T], str]) -> str:
        return build_expr(item)

_: P = C()

Expected behavior

No warnings.

Actual behavior

image

@judej
Copy link
Contributor

judej commented Sep 13, 2021

Thanks for the report.

@judej judej added the needs investigation Could be an issue - needs investigation label Sep 13, 2021
@github-actions github-actions bot removed the triage label Sep 13, 2021
@erictraut
Copy link
Contributor

This will be fixed in the next release.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed needs investigation Could be an issue - needs investigation labels Oct 1, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.10.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#2021100-6-october-2021

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

4 participants