[ty] Improve robustness of various type-qualifier-related checks#24251
[ty] Improve robustness of various type-qualifier-related checks#24251AlexWaygood merged 1 commit intomainfrom
Conversation
Typing conformance resultsThe percentage of diagnostics emitted that were expected errors held steady at 86.76%. The percentage of expected errors that received a diagnostic held steady at 81.53%. The number of fully passing files held steady at 70/132. SummaryHow are test cases classified?Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (
True positives changed (2)2 diagnostics
|
Memory usage reportMemory usage unchanged ✅ |
|
0df65a0 to
825d237
Compare
e0b6be4 to
e4a6f0e
Compare
4dd20b4 to
82efcdd
Compare
82efcdd to
0bf4a84
Compare
e4a6f0e to
17c5acf
Compare
Summary
Some type qualifiers are only valid in certain contexts, even inside annotation expressions. For example,
x: ClassVar[int]is only valid inside a class scope, and even then, it's only valid if the class is not aTypedDict. We already have checks to catch this kind of error, but the checks have some gaps. This PR fixes the gaps by using exhaustivematches over theTypeQualifierandCodeGeneratorKindenums.Test Plan
Pre-existing TODOs in mdtests are fixed, and new mdtests are added.