This changes how valid_redefinition deals with type parameters by introducing type_param_mode to unification and using a special TpDefinition mode. When encountering a type parameter to type parameter assignment in that mode, we pair the two up and admit the unification. Once we're done with that, we check that the constraints.
Constraint checks now use unification instead of type equality, which means that they respect variance. See the tests for examples, I hope I got everything right.
This shouldn't outright break anything but there's a chance we're adding type holes.
This changes how
valid_redefinition
deals with type parameters by introducingtype_param_mode
to unification and using a specialTpDefinition
mode. When encountering a type parameter to type parameter assignment in that mode, we pair the two up and admit the unification. Once we're done with that, we check that the constraints.Constraint checks now use unification instead of type equality, which means that they respect variance. See the tests for examples, I hope I got everything right.
This shouldn't outright break anything but there's a chance we're adding type holes.
Closes #11411.