[red-knot] Reduce false positives on super() and enum-class attribute accesses (#17004)

## Summary

This PR adds some branches so that we infer `Todo` types for attribute
access on instances of `super()` and subtypes of `type[Enum]`. It reduces
false positives in the short term until we implement full support for
these features.

## Test Plan

New mdtests added + mypy_primer report
This commit is contained in:
Alex Waygood
2025-03-27 17:30:56 -04:00
committed by GitHub
parent c963b185eb
commit 992a1af4c2
5 changed files with 63 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ def f():
reveal_type(a7) # revealed: None
reveal_type(a8) # revealed: Literal[1]
# TODO: This should be Color.RED
reveal_type(b1) # revealed: Unknown | Literal[0]
reveal_type(b1) # revealed: @Todo(Attribute access on enum classes)
# error: [invalid-type-form]
invalid1: Literal[3 + 4]