Closed
Description
Currently we store non-normalized predicts in the environment and normalize as we go, but we don't do that for projection, because it leads to a kind of infinite loop -- normalizing something requires drawing on the environment which requires normalizing something.
Here is an example of code that does not compile as a result:
pub trait Integral {
type Opposite;
}
impl Integral for i32 {
type Opposite = u32;
}
impl Integral for u32 {
type Opposite = i32;
}
pub trait FnLike<A> {
type R;
}
fn foo<T>()
where T : FnLike<<i32 as Integral>::Opposite, R=bool>
{
bar::<T>();
}
fn bar<T>()
where T : FnLike<u32, R=bool>
{}
fn main() { }
This is blocking my attempts to make the fn return as associated type, because a situation much like the above arises when you do that.