fix(vars): resolve fields of parametrized generic TypedDict vars
Fixes #7846
Problem
A state var (or a casted Var) typed as a parametrized generic TypedDict, such as P[int], raised VarAttributeError on key access, while the non-generic equivalent and dict[str, int] worked.
Cause
get_attribute_access_type only resolved fields for bare classes. A specialization like P[int] is a generic alias, so it fell through and returned None.
Fix
For a generic alias whose origin is a TypedDict, resolve the fields with the existing get_typed_dict_field_types, which already applies the type arguments.
Tests
test_get_attribute_access_type_generic_typed_dicttest_generic_typed_dict_var_item_access
Both fail on main and pass with this change. Ruff check and format are clean. Pyright could not run locally (broken Node install), so CI will be its first run. A news fragment is included.
Not covered: _determine_value_type for these types (.values() on a P[int] var), which is outside this issue.
AI disclosure
This change was written with AI assistance (Claude Code). I reviewed the diff and I am responsible for its contents.
🤖 Generated with Claude Code