mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 14:00:51 -05:00
As discussed today, this is needed to handle legacy generic classes without having to infer the types of the class's explicit bases eagerly at class construction time. Pulling this out into a separate PR so there's a smaller diff to review. This also makes our representation of generic classes and functions more consistent — before, we had separate Rust types and enum variants for generic/non-generic classes, but a single type for generic functions. Now we each a single (respective) type for each. There were very few places we were differentiation between generic and non-generic _class literals_, and these are handled now by calling the (salsa cached) `generic_context` _accessor function_. Note that _`ClassType`_ is still an enum with distinct variants for non-generic classes and specialized generic classes.
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/red_knot_test/README.md for documentation of this test format.