Skip to content

Type not resolved for generic TypedDict with extra_items=T #10545

@Daraan

Description

@Daraan

Describe the bug
I created a generic TypedDict which should have extra_items=T of the same type, however the sub scripted type is not resolved and is rather T@TD.

Code or Screenshots
Code sample in pyright playground

from typing_extensions import TypedDict

class TD[T](TypedDict, extra_items=T):
    a: T

d1: TD = {"a":1}
d2: TD[int] = {"a":1}

reveal_type(d1["other"])  # T@TD  # expected Unknown
reveal_type(d2["other"])  # T@TD  # expected int

VS Code extension or command-line
1.1.401

Metadata

Metadata

Assignees

No one assigned

    Labels

    addressed in next versionIssue is fixed and will appear in next published versionbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions