Skip to content

Tracker: Support all type guards from Pyright #650

@yangdanny97

Description

@yangdanny97

Describe the Bug

From https://microsoft.github.io/pyright/#/type-concepts-advanced?id=type-guards

Type guards of the form x.y or x[y] are all partially-supported: we currently apply the narrowing to the type of x[y], but do not narrow the type of x (if it's something that can be discriminated by that field/index/key)

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions