-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
astral-sh/ruff
#21754Labels
bugSomething isn't workingSomething isn't workinggenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Milestone
Description
Summary
from typing import Self, reveal_type
class Foo[T]:
def foo(self) -> T:
raise NotImplementedError
class Bar:
def _(self, x: Foo[Self]):
reveal_type(x.foo) # revealed: bound method Foo[Self@_].foo() -> Foo[Self@_]
def f[T: Bar](x: Foo[T]):
reveal_type(x.foo) # revealed: bound method Foo[T@f].foo() -> T@fThe return type of the first is incorrect.
Originally found in astral-sh/ruff#21685 (comment). I bisected this to astral-sh/ruff#20677.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation