Latest Results
[ty] Avoid re-querying enum metadata (#25276)
## Summary
On `main`, `EnumLiteralType` and `EnumComplementType` store a plain
`ClassLiteral`. That identifies the class, but doesn't retain the fact
that enum recognition "succeeded" or any of the enum data we need later
on. So member lookup, union and intersection normalization,
exhaustiveness checking, and alias resolution call `enum_metadata` again
to recover the member set, aliases, and value types.
Those repeated queries are problematic because `enum_metadata` depends
on inference, while inference itself performs normalization and member
lookup on enum literals and complements. Querying the metadata again
from those derived types can add a dependency back into the computation
that created them, introducing a Salsa cycle.
During cycle recovery, callers can observe unavailable or provisional
metadata even though they already have an enum-specific type;
`UnionBuilder` already has fallback logic and a TODO for this.
This PR introduces `EnumClassLiteral`, which pairs the underlying
`ClassLiteral` with the canonical member names, member value types, and
aliases captured when the class is recognized as an enum.
`ClassLiteral::into_enum_class` becomes the recognition and
materialization boundary, and `EnumLiteralType` and `EnumComplementType`
store the resulting witness instead of a bare class literal. Latest Branches
-5%
micha/salsa-1177-benchmark +4%
charlie/codex-cache-is-never-satisfied 0%
mixed-variable-tuple-slice © 2026 CodSpeed Technology