-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Labels
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
No error should be emitted on this snippet:
class A:
pass
class B:
x: int = 0
def _[C: A | B](c: C):
if isinstance(c, B):
reveal_type(c)
c.x = 42More discussion here: astral-sh/ruff#18527 (comment)
Example: https://play.ty.dev/62d91bdb-cbf1-4758-8f2c-6a26722c9f47
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