-
Notifications
You must be signed in to change notification settings - Fork 216
Open
0 / 20 of 2 issues completedLabels
control flownarrowingrelated to flow-sensitive type narrowingrelated to flow-sensitive type narrowing
Milestone
Description
We already have basic support for control flow analysis and type narrowing in match statements, but our support is not complete. The list below shows some examples of things that are not working yet, but is probably not exhaustive:
-
Type inference for names that are bound in patterns:
from dataclasses import dataclass @dataclass class Person: name: str age: int def f(person: Person): match person: case Person(name, age): reveal_type(name) # @Todo(`match` pattern definition types) reveal_type(age) # @Todo(`match` pattern definition types) def g(xs: list[int]): match xs: case [1, 2, x]: reveal_type(x) # @Todo(`match` pattern definition types)
-
Support for
__match_args__
Reactions are currently unavailable
Sub-issues
Metadata
Metadata
Assignees
Labels
control flownarrowingrelated to flow-sensitive type narrowingrelated to flow-sensitive type narrowing