[ty] Add fast path to `check_class_pair` for early MRO rejection
Before iterating the full (possibly specialized) MRO with `when_any`
(which doesn't short-circuit on `never()` results), first do a cheap
check: iterate the unspecialized MRO comparing only class literals.
If the target's class literal isn't found and there are no dynamic
bases, return `never()` immediately.
This avoids expensive specialization checks and constraint-set
operations for the common case where the target class is not in the
source's MRO.
https://claude.ai/code/session_014Cx1fZCq5GWfHsnxdx8nVL
[ty] Fix Top materialization to respect TypeVar bounds and ignore defaults
When computing `Top[Foo]` for an unparameterized generic class, TypeVar
bounds were ignored (materializing to `object` instead of the bound) and
TypeVar defaults were used instead of the widest possible type.
Two fixes applied:
1. In `Specialization::materialize_impl`, cap materialized types by the
TypeVar's upper bound when materializing in the widening direction.
2. In `Specialization::materialize_impl`, detect when a TypeVar's value
matches its default and replace with `Unknown` for proper widening.
3. In `ClassLiteral::top_materialization`, use upper bounds directly for
covariant/bivariant TypeVars via new `upper_bound_specialization`.
https://claude.ai/code/session_017dAXrsVcmMYhtL4eTCfPUf