ruff
f6cdb46f - [ty] Share names in synthesized constructor parameters (#28398)

Commit
32 days ago
[ty] Share names in synthesized constructor parameters (#28398) When synthesizing constructor parameters for dataclasses and named tuples, we rebuild each unaliased field name from `&str`. Names longer than 16 bytes therefore allocate again even though the field already owns shared storage. Clone the existing `Name` when no alias is present so the generated parameter shares its allocation with the field. Aliased parameters retain their existing names.
Author
Parents
Loading