[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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user