Skip to content

Question on variance text #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
choppsv1 opened this issue Mar 25, 2025 · 1 comment · Fixed by #493
Closed

Question on variance text #483

choppsv1 opened this issue Mar 25, 2025 · 1 comment · Fixed by #493

Comments

@choppsv1
Copy link

choppsv1 commented Mar 25, 2025

I'm reading through the subtyping and variance chapter and the following text confused me:

Also, we saw that it was not ok for us to treat
`&mut &'a U` as a subtype of `&mut &'b U`,
therefore we can say that `&mut T` is *invariant* over `T`

Why is U introduced in the premise here and then not used in the conclusion? Shouldn't the premise just use T again, or if for some reason no, shouldn't the conclusion at least use U?

@senekor
Copy link
Contributor

senekor commented May 22, 2025

Yeah, I think there's no reason for that. Using T consistently would be more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants