-
Notifications
You must be signed in to change notification settings - Fork 273
Description
The concept of top and bottom materialization of a type was added in astral-sh/ruff#18594.
@carljm mentioned that this could potentially be used to perform assignability, especially when gradual types are involved. Formally, if we want to check whether T is assignable to U, then we could check whether T', the bottom materialization (or lower bound materialization) of T, is a subtype of U', the top materialization (or upper bound materialization) of U.
The main benefit here is that this would eliminate any special handling of gradual types in the subtyping check and could eliminate any potential bugs that might exists in the current assignability implementation.
This issue is to keep track of this potential change if we decide to do it.
This would still require fulfilling the TODOs that are currently present in the implementation of type materialization in Type::materialize.