Files
Carl Meyer 837da15ed3 [ty] Fix a panic checking class decorators with inferred return types (#30399)
ty could panic when checking a decorated class if it inferred the return
type of an inner decorator and an outer decorator returned a class from
another module. During cycle recovery, ty could use that replacement
class's scope to look up names in the file that defined the original
class.

Preserve the original class before applying decorators and use it for
class-definition checks. The decorated name still takes the type
returned by the outer decorator.

Fixes astral-sh/ty#5021.

## Test plan

Checked the reported `EnumCheck` example with return type inference
enabled. Before this change it panicked. With the fix, ty reports the
invalid argument to `@d2` and finishes checking the file.
2026-11-13 09:47:55 +01:00
..