Revert "[ty] Detect illegal non-enum attribute accesses in Literal annotation"

This reverts commit cbc8c08016.
This commit is contained in:
David Peter 2025-07-22 09:19:44 +02:00
parent cbc8c08016
commit 30683e3a93
3 changed files with 8 additions and 28 deletions

View file

@ -51,13 +51,6 @@ invalid4: Literal[
hello, # error: [invalid-type-form]
(1, 2, 3), # error: [invalid-type-form]
]
class NotAnEnum:
x: int = 1
# error: [invalid-type-form]
def _(invalid: Literal[NotAnEnum.x]) -> None:
reveal_type(invalid) # revealed: Unknown
```
## Shortening unions of literals