You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot have the same supertrait twice, but with different type parameters #10596
I am writing a Euclidean Vector class, and want to override some operations for it. However, when I try to add mul for both Vector-Vector multiplication and Vector-Scalar multiplication, the compiler complains that there is a Duplicate supertrait in trait declaration:
euclidean_vector.rs:5:0:20:1 error:Duplicate supertrait in trait declaration
euclidean_vector.rs:5pubtraitEuclideanVector<T:Num + Algebraic>:euclidean_vector.rs:6Add<Self,Self> +
euclidean_vector.rs:7Sub<Self,Self> +
euclidean_vector.rs:8Mul<Self,Self> +
euclidean_vector.rs:9Mul<T,Self> +
euclidean_vector.rs:10One + Zero +
Activity
emberian commentedon Apr 7, 2014
cc @nikomatsakis, does your current work also include this?
nikomatsakis commentedon Apr 9, 2014
On Mon, Apr 07, 2014 at 10:42:04AM -0700, Corey Richardson wrote:
Yes.
nikomatsakis commentedon Nov 3, 2014
Actually that's not true. That portion of the work never landed.
nikomatsakis commentedon Nov 3, 2014
e.g. this example still fails to compile:
I think there are some subtle issues here that would have to be addressed eventually, particularly around object types.
nikomatsakis commentedon Mar 3, 2015
I've wound up fixing this kind of by accident as part of another patch.
Auto merge of rust-lang#10596 - blyxyas:book-write_tests, r=flip1995
Merge rust-lang#10596