Generics and the trait system