-
Notifications
You must be signed in to change notification settings - Fork 184
Generalize with variance #673
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
Conversation
873e3f7
to
9e0da9e
Compare
@@ -660,7 +740,9 @@ impl<'t, I: Interner> Unifier<'t, I> { | |||
if matches!(kind, TyVariableKind::Integer | TyVariableKind::Float) { | |||
ty.clone() | |||
} else if let Some(ty) = self.table.normalize_ty_shallow(interner, ty) { | |||
self.generalize_ty(&ty, universe_index) | |||
self.generalize_ty(&ty, universe_index, variance) | |||
} else if matches!(variance, Variance::Invariant) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rustc code here also checks that this variable can name universe_index
here, although that's maybe only for error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. So should I change this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we can keep the simpler code for now.
@bors r+ |
📌 Commit 9bf2ba0 has been approved by |
☀️ Test successful - checks-actions |
If it's not too much of a hassle, would it be possible to publish a new version to crates.io? There's one or two |
@lnicola just kicked off a publish |
Note to self: we should do |
Closes #667