-
Notifications
You must be signed in to change notification settings - Fork 181
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
Weird bug around projections #144
Comments
It seems related to the fact that trait Bar<T> { }
trait Foo { type Item<T>: Bar<T>; }
Also, considering these lines: if I change the
so it seems to be linked with the skolemized type. |
Ok the funny thing is that this goal: forall<U, T> {
if (T: Foo) {
<T as Foo>::Item<U>: Bar
}
} (note that Basically, in the setting described in my first comment, we are looking for a type
so |
OK, let me try to spell out what is happening. I see the problem that @scalexm specified:
I think this last step is in error. I think when we re-instantiate an answer, we should create its variables in the most recent universe within the caller. |
I have a branch ( |
@scalexm and I were talking about the bug that I am afraid in #wg-traits on Discord (GUID b713dffa-1603-43c9-8418-3dc11979487c, that marks the end). UPDATE: link to Discord |
This can no longer be reproduced with ef45646: ?- forall<T, U> { if (T: Foo) { <T as Foo>::Item<U>: Bar } }
Unique; substitution [], lifetime constraints [] |
Given the following traits:
and the following goal:
we give
No solution
whereas this should beUnique
. Note that if we remove the generic parameter fromItem
, this works fine.Basically at some point, the projection type
<T as Foo>::Item<U>
fails to unify with the skolemized type, as we can see in the debug log:Note that the following answers
Unique
as expected:cc @nikomatsakis
The text was updated successfully, but these errors were encountered: