mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:04:51 +00:00
![]() ## Summary Resolves #20266 Definition of the frozen dataclass attribute can be instantiation of a nested frozen dataclass as well as a non-nested one. ### Problem explanation The `function_call_in_dataclass_default` function is invoked during the "defined scope" stage, after all scopes have been processed. At this point, the semantic references the top-level scope. When `SemanticModel::lookup_attribute` executes, it searches for bindings in the top-level module scope rather than the class scope, resulting in an error. To solve this issue, the lookup should be evaluated through the class scope. ## Test Plan - Added test case from issue Co-authored-by: Igor Drokin <drokinii1017@gmail.com> |
||
---|---|---|
.. | ||
analyze | ||
cfg | ||
model | ||
binding.rs | ||
branches.rs | ||
context.rs | ||
definition.rs | ||
globals.rs | ||
imports.rs | ||
lib.rs | ||
model.rs | ||
nodes.rs | ||
reference.rs | ||
scope.rs | ||
star_import.rs |