Skip to content

no error on invalid argument to dataclass_transform #4430

Description

@DetachHead

Describe the Bug

from typing import dataclass_transform


@dataclass_transform(asdfsadf=True) # no error
def dataclass[T: type](t: T) -> T:
    return t

from the spec:

  • kwargs allows arbitrary additional keyword args to be passed to dataclass_transform. This gives type checkers the freedom to support experimental parameters without needing to wait for changes in typing.py. Type checkers should report errors for any unrecognized parameters.

pyright reports an error in this case

Sandbox Link

https://pyrefly.org/sandbox/?project=v2.I6HIhOe--JKixLxiYCzkxoAiHYoRuRMhr5FYnJJWnJiSZguKCE0FZYW8fEjognSAkglcU3SIFci-1FiNEiuFEHDCCbECqUJKiiUgPrHhbgIKpoKi1OLUErAQMPpi8IcFAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions