Skip to content

TypedDict constructor validation doesn't run for unions #3224

@charliermarsh

Description

@charliermarsh

We show no diagnostics for:

from typing import TypedDict

class Foo(TypedDict):
    a: int

class Bar(TypedDict):
    a: int

def f(T: type[Foo | Bar]):
    T(a="baz")

https://play.ty.dev/4d97ff89-b725-4ef3-918a-aeb75d817bae

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions