These basically don't work well together. The following works:
pub trait Bar {
type B;
}
pub trait Foo: Bar<A=int> {
type A;
}
The following gives an error (the wrong error too), but should compile:
pub trait Bar {
type B;
}
pub trait Foo: Bar {
type A;
}
In this case, B should be treated like an associated type on Foo.
I am not sure if type B = int or even type B: Baz should be allowed in Foo, but I assume not (at least for now).
When the above works, we should require super trait associated types are given in type bindings, e.g., Foo<A=int, B=int>.
We should also allow Self::B in the body of Foo and if type T has bound Foo, then we should allow T::B.
These basically don't work well together. The following works:
The following gives an error (the wrong error too), but should compile:
In this case,
Bshould be treated like an associated type onFoo.I am not sure if
type B = intor eventype B: Bazshould be allowed inFoo, but I assume not (at least for now).When the above works, we should require super trait associated types are given in type bindings, e.g.,
Foo<A=int, B=int>.We should also allow
Self::Bin the body ofFooand if typeThas boundFoo, then we should allowT::B.