@AlexWaygood:
I wondered if class.top_materialization() would work here, but it looks like under the hood that uses default_specialization(), so it suffers from the same issue as our current logic on main. (It probably shouldn't use default_specialization()?)
@dcreager
I think you're right — it should translate typevars into the bound/constraints in covariant position, and to Never (the implicit lower bound of every typevar) in contravariant position. (With the caveat that we can't really express the constraints of a constrained typevar as a single type — we'd need a "one-of" connective instead of union, and an "instance of this type but not any subtypes".)
Originally posted by @AlexWaygood in astral-sh/ruff#20325 (comment)
@AlexWaygood:
@dcreager
Originally posted by @AlexWaygood in astral-sh/ruff#20325 (comment)