Repository navigation
Conversation
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D114191657. (Because this pull request was imported automatically, there will not be any future comments.) |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
kinto0
approved these changes
Jul 30, 2026
kinto0
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Contributor
|
@yangdanny97 merged this pull request in 32bfc9d. |
avokin2
pushed a commit
to avokin2/pyrefly
that referenced
this pull request
Aug 12, 2026
Summary: Report a bad-class-definition error on the second and subsequent dataclasses.KW_ONLY markers in a single dataclass. The diagnostic is attached to the duplicate declaration and matches the runtime rule enforced by dataclasses. This keeps valid inheritance behavior unchanged because markers are counted independently in each class body. Fixes pyrefly-org#3737 Pull Request resolved: pyrefly-org#4373 Test Plan: - CARGO_TARGET_DIR=/tmp/pyrefly-target cargo test test_duplicate_kw_only_sentinel - CARGO_TARGET_DIR=/tmp/pyrefly-target cargo test test::dataclasses:: (148 passed) - CARGO_TARGET_DIR=/tmp/pyrefly-target python3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema - git diff --check AI disclosure: This change was prepared with an AI coding agent and manually validated against the repository tests and contribution guidance. Reviewed By: kinto0 Differential Revision: D114191657 Pulled By: yangdanny97 fbshipit-source-id: f572b8f5c4337738fd162995795d9ee9e7f22c9f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Report a bad-class-definition error on the second and subsequent dataclasses.KW_ONLY markers in a single dataclass. The diagnostic is attached to the duplicate declaration and matches the runtime rule enforced by dataclasses.
This keeps valid inheritance behavior unchanged because markers are counted independently in each class body.
Fixes #3737
Test Plan
AI disclosure: This change was prepared with an AI coding agent and manually validated against the repository tests and contribution guidance.