pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

[feature] don't allow Required & NotRequired to appear at the same time as a qualifier for TypedDict fields

Open yangdanny97 opened this issue 8 months ago • 0 comments

Describe the Bug

Something like this should not be allowed:

class TD(TypedDict):
    x: Required[NotRequired[int]]
    y: NotRequired[Required[int]]

The check should probably go here: https://github.com/facebook/pyrefly/blob/c6a5b667065373cdad63e3fbadaba1baa0675998/pyrefly/lib/alt/solve.rs#L469

Once this is done, please add a test to: https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/test/typed_dict.rs

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

yangdanny97 avatar May 31 '25 21:05 yangdanny97